Expand description
Fuzzy matching scored as fzf scores it, so ranking matches the finder people already
know (fzf, fzf-lua, Telescope’s fzf-native and snacks.picker, a port of
fzf/src/algo/algo.go, all agree). The scoring constants are fzf’s:
- a match right after
/or_beats one mid-word - consecutive characters beat scattered ones
- a match in the file name beats one in a directory
- the best alignment wins, not the first found (
revdetaillands onrevenue, not thereinwarehouse)
Structs§
- Match
- A match: its score and the characters that made it, from the same alignment, so highlights show what was scored.
Functions§
- best_
match - The best fuzzy match of
needleinhaystack, orNone: every start is tried and the highest alignment wins. Case-insensitive; an empty needle matches with score 0. - is_
match - Whether
needlematches at all, without scoring: a one-pass gate beforebest_match, since most candidates fail. - substring_
rank - Where a needle sits in a name, for a list narrowed by substring: the whole name
(0), its start (1), or inside it (2).
Nonewhen the name does not contain it. Case-insensitive; an empty needle is inside every name.