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
Having written use-pack I press C-M-i to begin completion.
I type age but ivy still does not match use-package
Rather than select a completion or quit with C-g (which would make me lose the age that I've typed), I C-M-j (ivy-immediate-done) to just keep what I'd written. But this deletes the prefix to the completion.
I think the problem is twofold:
The matcher for in-buffer completion should prioritize exact matches
C-M-j should insert what I've typed but not delete the prefix
The text was updated successfully, but these errors were encountered:
I can't do anything about the matcher, as far as I see. The perfect match logic (when the text is exactly one of the candidates, that candidate is selected) won't work here, since your text is package, not use-package. A quick fix is to add $ to your input.
I experimented with one solution, using e.g.
(ivy-read "test: ":initial-input"use-")
But then it's not fuzzy anymore without adding a space, e.g. use-age won't match anything (the same thing works properly now).
This isn't a good fix either:
(ivy-read "test: ":initial-input"use- ")
Now it's fuzzy, but the perfect match is out the window, and a space will be added by C-M-j.
Another fix might be to special case the shortest match to always appear at the top. I think definitionally the shortest match to a given query ("age") which also shares the prefix ("use-pack") should be the exact match always, no?
edit: ah, that's not true. I might do "use" [tab] "age", and it it might match use-page over use-package. Still, preferring shorter is good imo. If you want sth longer you can always SPC and type more to disambiguate, but when you've already typed everything and it's still not matching, you have to move to the selection.
Having written
use-pack
I pressC-M-i
to begin completion.I type
age
but ivy still does not matchuse-package
Rather than select a completion or quit with
C-g
(which would make me lose theage
that I've typed), IC-M-j
(ivy-immediate-done
) to just keep what I'd written. But this deletes the prefix to the completion.I think the problem is twofold:
The text was updated successfully, but these errors were encountered: