-
Notifications
You must be signed in to change notification settings - Fork 177
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
Make MCFLY_FUZZY a tuneable int #203
Conversation
What happens for folks who have it currently set to |
Any string value resolves to 0, disabling fuzzy searching until an int factor >0 is supplied. It is a little disruptive, but I'm also thinking of people who might otherwise not realize there are improvements -- and, hopefully, getting a few more interested parties from the issue to help test and improve the weighting before this lands. |
I think it'd be better to be backward compatible and make 'true' map to '1' (or whatever numerical score you think has the best experience). |
Also, please run rustfmt. Thanks! |
I had the idea of including match start position in the weighting, so earlier as well as shorter matches are preferred. That makes a big difference already, but a |
if let Ok(fuzzy) = i16::from_str(&fuzzy) { | ||
settings.fuzzy = fuzzy; | ||
} else { | ||
settings.fuzzy = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be something like (in pseudocode) if fuzzy.to_lowercase() != "false" { settings.fuzzy = 2; }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, you're right -- fixed.
Thanks! |
Released in 0.5.10. |
Experimenting based on discussion in #183
No extra weight:
No elaboration needed, it's not great.
Shorter match weighted x2:
Immediate improvement, with actual ssh commands at the top and most other sorting fairly reasonable. The
./target/relea[se/mcfly search]
match is ahead ofvi [sql.zsh]
, but I've definitely run the former several times in this directory (and the latter never).Shorter match weighted x10:
There's a point of diminishing returns here and 10 may be past it;
./target/relea[se/mcfly search]
is pushed way down, and even higher values (x20, x50) don't look much different.