elken / yasnippet-capf

Completion-At-Point Extension for YASnippet
GNU General Public License v3.0
40 stars 9 forks source link

fix: ensure a space between candidate & annotation #16

Closed LemonBreezes closed 10 months ago

LemonBreezes commented 10 months ago

Ensure there is at least a single space between the completion candidates and their annotations.

EDIT: I have just increased the default to 2 spaces and made that prefix customizable.

elken commented 10 months ago

What does this fix exactly?

LemonBreezes commented 10 months ago

What does this fix exactly?

Sure. This is before: image and this is after: image Corfu sets the window width based on corfu-min-width, which is 15 by default. Anything past that and Corfu just right-aligns the annotation and left-aligns the candidates. If there is no spacing to the left of the annotation, you can end up with the candidates & annotations crunched together.

elken commented 10 months ago

Seems like a better fix is to upstream a generic fix to corfu to ensure there's a gap, since this would apply to anything.

LemonBreezes commented 10 months ago

Seems like a better fix is to upstream a generic fix to corfu to ensure there's a gap, since this would apply to anything.

Actually though, Company does the same thing in company-yasnippet image Company has an option which basically does that concatenation globally image but then you have to build the annotation functions around having that variable (like how company-yasnippet does), so I think this is the better approach to be honest.

elken commented 10 months ago

Definitely better to have the fix in corfu otherwise every single package has to implement the same thing.

LemonBreezes commented 10 months ago

Definitely better to have the fix in corfu otherwise every single package has to implement the same thing.

https://github.com/minad/corfu/issues/382 Minad said that by definition the :annotation-function or :affixation-function should already return a string with a leading space.