-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Rank prefix-matches higher than orderless-literal and orderless-regexp #188
Comments
Orderless does no candidate ordering at all! I consider it out of scope for orderless. In Emacs there are too many places where completion candidates can be ordered: (1) the candidates are usually put into a list or alist which of course has an ordering, (2) then the completion metadata can specify an ordering function, (3) a completion style can reorder matches, (4) the completion UI can displays candidates in any order it wants. Even if orderless did reorder its candidates, there is no guarantee you'd ever see the order, since a completion UI can later reorder them however it wants. In practice, I don't think completion styles usually reorder matches; I am only aware of one built-in completion style that does this, namely |
Thanks for the response. I am using orderless in combination with vertico. Do you maybe have a hint where to look to fix my problem? I like the matching of orderless, but often I prefer the literal prefix matches to be at the top as they are the most likely candidates. And it's strange to see candidates appear on top that have my input somewhere in the middle or near the end rank higher than literal prefixes. Edit: just found vertico-sort-function, maybe I can figure it out with that. |
Be careful when modifying the sorting of candidates, you probably only want to do it sometimes. For example, if you use consult-line you probably always want the lines in the order they appear in the buffer. |
Thanks. I also just realized that vertico combined with |
Hi
Can i configure orderless so that the items that match my input at the beginning are ranked higher and shown above other matches, but still show all other matches?
E.g. if there are three candidates
and i type
bar
, thenbar-foo
should appear abovefoo-bar
, even though both are matched.I tried
but it seems the order of the styles in this list is not considered in the final ranking.
The text was updated successfully, but these errors were encountered: