Closed mattie20 closed 1 month ago
Does --scheme=path
help?
fzf --tiebreak end --scheme path --query engine << EOF
Documents/c++code/pascal.wiki/engine.md
Documents/Archive/College/ME4201/AIAA EOP/Gas Turbine Engine Pictures/J79.JPG
Documents/Archive/College/ME4201/AIAA EOP/Gas Turbine Engine Pictures/CFM56 High Bypass Turbofan Engine.jpg
EOF
It's because in the default scheme, Engine
after a space gets a higher bonus score than engine
after /
.
--scheme=path
makes fzf use the same bonus point for both cases.
Come to think of it, it's a little strange that we don't use --scheme=path
as the default when using fzf for files (i.e. using its default walker), let me see what I can do.
On second thought, I think it can be confusing to use different defaults on different contexts. While the default scheme gives a less desirable result in this case, it works okay in most cases where file names don't contain spaces.
Hopefully, 64faaf61f3030c006392bce7e370200b912ad001 will help users better understand the options.
--scheme=path
does exactly what I need. I haven't really had many problems with the default beyond this, so I wouldn't worry about it too much. Plus, it would hurt results if you were, for example, looking through man pages. Thank you!
Checklist
man fzf
)Output of
fzf --version
0.46.1
OS
Shell
Problem / Steps to reproduce
The command
produces with a search term of "engine"
I have omitted the hundred or so files in-between. The one which I would imagine should be below the second file is at the top. I'm not sure why the first file is prioritized and most of the others with "engine" at the very end are so far away, or if this is the expected behavior.
When used with "tiebreak=length" the following similar result happens: