Just recording some observations I found.
Problem:
When a user sets cot=fuzzy
, the completion candidates are not collected based on fuzzy criteria. As a result, the completion menu can miss items. For example, typing f
and triggering completion will not show xfoo
as a candidate.
This behavior is inconsistent with VSCode and other modern IDEs. Additionally, the resulting list was not sorted (this is fixed by #18497).
Currently, to make fuzzy completion work correctly, a user has to know about the obscure completefuzzycollect
option and set it to keyword
. This is unnecessary and confusing. End users generally don’t care about the difference between “collection” vs “filtering”; exposing this implementation detail results in poor UX.
Proposed solution:
If a user sets cot=fuzzy
, then always:
Examples:
:set cot=fuzzy
→ fuzzy collect + fuzzy sort.:set cot=longest,fuzzy
→ fuzzy collect + fuzzy sort, but compute longest
only from matches whose prefix matches the typed text. All matches are shown. (This mirrors the current behavior when :set completefuzzycollect=keyword
.)Note: In the
longest,fuzzy
case, computinglongest
from a subset of visible matches may feel a little unintuitive. This just needs to be documented.
Relevant discussion: #15295, which led to the current design.
Instructions: Replace the template text and remove irrelevant text (including this line)
Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
A clear and concise description of what is hard to do. Ex. It is difficult to [...] when [...]
(If it is related to runtime files, please check their header for where to discuss enhancements.)
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I don't have any particular strong opinion here and it wouldn't be too late to retire the completefuzzycollect
option, if everybody agrees that the completefuzzycollect option is not particular useful. So let me ping a few folks from the previous discussion @ychin @habamax @glepnir @roccomao
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I support removal of that setting, if enabled, fuzzy should work for both collection and filtering.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I remember it was introduced because some users needed to disable fuzzy matching for certain patterns. It doesn’t really affect me, so let’s first evaluate the user’s needs
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.