mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.86k stars 712 forks source link

[Feature] Take length of completion into account when sorting #3329

Open JJK96 opened 4 years ago

JJK96 commented 4 years ago

In the following example, I would like to have the last match near the top, since it would be more work to type.

image

So in general, since a longer completion saves you more time, it should be more towards the top in the ordering of the completions.

I know that in this specific case I can just do c-p to get the match, but I'm talking about a general rule here.

mawww commented 4 years ago

That would be a big change in the ranking logic, and I think it would not work well in the cases where you have a lot of candidates as is would favor big words that just happend to subsequence match the query.

See ranked_match.hh/cc for the ranking logic, here the 3 first have priority because the query is a prefix, and prefix is pretty high in the raking logic (only beaten by being a full-match or a smart-case-full-match)