nuta / nsh

A command-line shell like fish, but POSIX compatible.
906 stars 34 forks source link

Improve fuzzy search to consider query characters order #3

Closed agatan closed 4 years ago

agatan commented 4 years ago

Current fuzzy search implementation does not consider query characters' order. For example, when the entries are "abc", "cba" and the query is "abc", the current implementation returns both of "abc" and "cba" as search results.

I think this behavior is not the best. In such cases, returning only "abc" is better for users. And many other fuzzy searchers (like fzf) returns only "abc" in this case.

nuta commented 4 years ago

Good idea! Thanks for the contribution!