Skip to main content

Module fuzzy

Module fuzzy 

Source
Expand description

Small reusable fuzzy ranking using the same nucleo configuration as the jump palette (smart case and normalization). Lets pickers offer type-to-filter without duplicating the full jump scoring pipeline. The matcher is cached in a thread-local so its scratch buffers are reused across keystrokes and frames instead of being reallocated on every call.

Functionsยง

rank
Fuzzy-rank candidates against query, keeping only matches, best score first. Each candidate carries its searchable haystacks (e.g. alias, hostname, provider, tags); the best-scoring haystack decides the rank. Ties keep input order. An empty query returns every candidate in input order (no filtering).
rank_host_indices
Fuzzy-rank the candidate host indices by the standard host search fields (alias, hostname, user, provider, and provider/user tags), best match first. An empty query keeps the candidate order. Shared by every host picker (tunnel, container, snippet) so type-to-filter behaves identically across the app and searches the same fields everywhere.