-
Notifications
You must be signed in to change notification settings - Fork 194
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
feature(picker): score bonus for file extension prefix match #787
Comments
fzf doesn't give bonusses for file extensions. But I think I should only award a camelcase bonus for patterns starting at a camel-case position. Will look into it. |
Found the issue. I didn't account for gaps in calculating the prev character class for transition bonusses. |
Thanks, that was fast! Though it doesn't quite work in all cases. Add |
I made some additional changes to more align with fzf. Snacks does also give bonusses for matches in the file name similar to |
@folke, you're a true legend. This is now working perfectly! |
Did you check the docs?
Is your feature request related to a problem? Please describe.
fzf assigns a score bonus for fully matched prefixes in the file extension, but it doesn't look like snacks.picker does this.
Example:
mkdir example && cd example
touch Foo.cpp Foo.hpp FooConfig.cpp
:lua Snacks.picker.files()
vs:FzfLua files
foocp
Compare the match. fzf matcher will select
Foo.cpp
since the "cp" is an exact prefix match of the extension. snacks selects FooConfig.cpp since the first "c" matches a longer prefix in the file name, but the last "p" is actually the second character of the extension.Describe the solution you'd like
The behavior of fzf here is desirable. It lets me quickly type part of a file name and part of the extension I want and more than likely get the file I'm looking for. In my example, if I actually wanted the config file, I'd type "fooconfcp" or something, but I'd do it intentionally.
Describe alternatives you've considered
fzf
Additional context
No response
The text was updated successfully, but these errors were encountered: