-
Notifications
You must be signed in to change notification settings - Fork 65
Description
When displaying the overlay box, the char-height is used to compute the total height of the box:
(-let* (...
(char-height (frame-char-height frame))
...))
Thing is: char-height isn't aware of additional line-spacing.
Example
Given this document:
Boooaaaaa
Boooiiiii
BooooooooAnd 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.