When we prepend a single quote to our query in --exact mode, we are not
supposed to limit the scope of the new search to the previous
exact-match result.
Based on the patch by Matt Westcott (@mjwestcott).
But with a more conservative approach:
- Does not use linearly increasing penalties; It is agreed upon that we
should prefer matching characters at the beginnings of the words, but
it's not always clear that the relevance is inversely proportional to
the distance from the beginning.
- The approach here is more conservative in that the bonus is never
large enough to override the matchlen, so it can be thought of as the
first implicit tiebreak criterion.
- One may argue the change breaks the contract of --tiebreak, but the
judgement depends on the definition of "tie".
Note that $SHELL only points to the default shell instead of the current
shell. If you're on a non-default shell, you might want to override the
value like follows.
SHELL=zsh fzf --bind 'enter:execute:echo $ZSH_VERSION; sleep 1'
Notes:
- You can now override _fzf_compgen_path and _fzf_compgen_dir functions
to use custom commands such as ag instead of find for listing
completion candidates.
- The first argument is the base path to start traversal
- Removed file-only completion in bash, i.e. _fzf_file_completion.
Maintaining a list of commands that only expect files, not
directories, is cumbersome (there are too many) and error-prone.
TBD:
- Added $FZF_COMPLETION_DIR_COMMANDS to customize the list of commands
which use directory-only completion. The default is "cd pushd rmdir".
Not sure if it's the best approach to address the requirement, I'll
leave it as an undocumented feature.
Related: #406 (@thomcom), #456 (@frizinak)
This change improves sort ordering for aligned tabular input.
Given the following input:
apple juice 100
apple pie 200
fzf --nth=2 will now prefer the one with pie. Before this change fzf
compared "juice " and "pie ", both of which have the same length.