Match characters of query in order (not necessarily consecutive) inside
target — same behaviour familiar from VSCode's quick-open or fzf.
Score higher when matches are consecutive or near the start.
Case-insensitive.
Pure + synchronous — no allocations beyond the result.
Non-goals: full fzf parity, Sublime-style heuristics, diacritic folding.
If the score function ever needs tuning the entire surface is two small
functions; replacing is one diff.
Returns null when there is no match. Returns a positive score otherwise;
higher = better.
Lightweight fuzzy matcher for inline filtering.
Goals:
queryin order (not necessarily consecutive) insidetarget— same behaviour familiar from VSCode's quick-open or fzf.Non-goals: full fzf parity, Sublime-style heuristics, diacritic folding. If the score function ever needs tuning the entire surface is two small functions; replacing is one diff.
Returns
nullwhen there is no match. Returns a positive score otherwise; higher = better.