company-box icon indicating copy to clipboard operation
company-box copied to clipboard

Take line-spacing into account when calculating height

Open yurikhan opened this issue 4 years ago • 7 comments

The frame height is calculated in company-box--set-frame-position as the character height in pixels multiplied by the number of items. The character height does not include line-spacing; this causes the calculated height to be too small.

This PR adds handling of possible non-nil line-spacing values.

yurikhan avatar Oct 16 '19 18:10 yurikhan

Additionally/alternatively, it would be nice if company-box--render-buffer called a hook at the end, so that the user could set line-spacing to nil specifically for the company-box buffer.

yurikhan avatar Oct 16 '19 18:10 yurikhan

I applied your patch in my branch, but still not fix this issue. Here is my screenshot:

image

stardiviner avatar Nov 02 '19 11:11 stardiviner

@stardiviner Are you sure you don’t have a stale .elc lying somewhere around?

yurikhan avatar Nov 02 '19 16:11 yurikhan

After testing out, I found this line-space wrong issue is caused by icons which from all-the-icons. If this patch can fit to all-the-icons line space or I have to disable icons.

stardiviner avatar Nov 02 '19 23:11 stardiviner

Icons are a different issue. Feel free to take it.

yurikhan avatar Nov 03 '19 07:11 yurikhan

Any idea to calculate the icon height? I want to take a try to add patch. @yurikhan

stardiviner avatar Nov 12 '19 11:11 stardiviner

I think its better to leave the calculation here naive and create hooks, that allow manual repositioning of the frame. This way it will be working properly with the defaults as well as allow further compatibility changes

i.e. if you are in emacs27 you'll have an issue with the new tab-line mode, where the company-box position will be completely broken :\

mpanarin avatar Nov 23 '19 13:11 mpanarin