You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thing is: char-height isn't aware of additional line-spacing.
Example
Given this document:
Boooaaaaa
Boooiiiii
Boooooooo
And given (setq-default line-spacing 0) (default),
and company-mode with the capf and dabbrev backend enabled, this is the completion I get when I type another line with "Boo":
(The box fits all lines exactly)
(dabbrev probably picks up "boolean" from somewhere)
Now set (setq-default line-spacing 0.2), see that the document and the box respect this setting; but the box doesn't take it into account when computing the total height of the box.
(The box cuts off the last line)
That in turn clips the result list. The total box's height is computed without the extra spacing in mind.
Suggestions
I believe that (line-pixel-height) would be a better fit to calculate the actual line height instead of the character height of the frame.
Example values:
line-spacing is 0.0
(frame-char-height): 24
(line-pixel-height): 24
line-spacing is 0.2
(frame-char-height): 24
(line-pixel-height): 28
I'm not sure if (line-pixel-height), which operates on the current window, is as good as a per-frame char-height, or if this has unintended side-effect. It works in my experiments. But the notion of the "current window" could be lots of different things, so I'm not certain if this is truly the best way.
The text was updated successfully, but these errors were encountered:
When displaying the overlay box, the
char-height
is used to compute the total height of the box:Thing is:
char-height
isn't aware of additionalline-spacing
.Example
Given this document:
And given
(setq-default line-spacing 0)
(default),and company-mode with the capf and dabbrev backend enabled, this is the completion I get when I type another line with "Boo":
(The box fits all lines exactly)
(dabbrev probably picks up "boolean" from somewhere)
Now set
(setq-default line-spacing 0.2)
, see that the document and the box respect this setting; but the box doesn't take it into account when computing the total height of the box.(The box cuts off the last line)
That in turn clips the result list. The total box's height is computed without the extra spacing in mind.
Suggestions
I believe that
(line-pixel-height)
would be a better fit to calculate the actual line height instead of the character height of the frame.Example values:
(frame-char-height)
: 24(line-pixel-height)
: 24(frame-char-height)
: 24(line-pixel-height)
: 28I'm not sure if
(line-pixel-height)
, which operates on the current window, is as good as a per-framechar-height
, or if this has unintended side-effect. It works in my experiments. But the notion of the "current window" could be lots of different things, so I'm not certain if this is truly the best way.The text was updated successfully, but these errors were encountered: