Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensuring spacing between candidates and their annotations #382

Closed
LemonBreezes opened this issue Oct 24, 2023 · 8 comments
Closed

Ensuring spacing between candidates and their annotations #382

LemonBreezes opened this issue Oct 24, 2023 · 8 comments

Comments

@LemonBreezes
Copy link

LemonBreezes commented Oct 24, 2023

Hi. So I PR'd a fix to Yasnippet Capf (elken/yasnippet-capf#16) addressing the lack of spacing between candidates and their annotations
image
I did so by concatenating two spaces to the annotations:
image
which is similar to what Company Yasnippet does when company-tooltip-align-annotations is nil:
image
@elken is suggesting that Corfu should do this instead so I'm wondering what you think about that and specifically whether you would add that.

I'm thinking that it's not a good idea for Corfu to add spacing since other capfs like Company Yasnippet and Pcmpl Args already manage that:
image
image
So I wanted you to hear what you think.

@minad
Copy link
Owner

minad commented Oct 24, 2023

Hi, by definition the :annotation-function or :affixation-function should already return a string with a leading space.

@elken
Copy link

elken commented Oct 24, 2023

Hi, by definition the :annotation-function or :affixation-function should already return a string with a leading space.

Is this documented anywhere? There's no such claim in the manual

@minad
Copy link
Owner

minad commented Oct 24, 2023

Is this documented anywhere? There's no such claim in the manual

Emacs is not specified well if you look at the fine details. Nevertheless it is a de factor definition. :annotation-function is defined by the default completion UI and the UI does not add any space. Neither does Vertico or any other UI.

@elken
Copy link

elken commented Oct 24, 2023

Emacs cruft once again...

@minad
Copy link
Owner

minad commented Oct 24, 2023

Not really. It seems actually reasonable to not add a space. Think for example about affixation-functions which want to add icons just right in front of the candidates.

@elken
Copy link

elken commented Oct 24, 2023

You'd still want the gap between the the candidate and the annotation, but this is moot anyway

@minad
Copy link
Owner

minad commented Oct 24, 2023

No, not in every case, like for example icons.

@minad
Copy link
Owner

minad commented Oct 24, 2023

I also imagine that in some special cases one would want something like candidate(1), where (1) is supplied by the annotation function. Anyway, even if the you disagree with the choice to not add a space, it would be unnecessary work to change this now. I mean we are not talking about a fundamental design flaw. It is just a fine detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants