lewang / flx

Fuzzy matching for Emacs ... a la Sublime Text.
GNU General Public License v3.0
518 stars 37 forks source link

case sensitive scoring. #105

Closed jcs090218 closed 4 years ago

jcs090218 commented 4 years ago

If I have following code. It gave me a same score. Is there a way to identify the scoring engine with case sensitive? Thanks!

(let ((str "lo"))
  (message "1. %s" (flx-score "log" str))
  (message "2. %s" (flx-score "Log" str)))
oscarfv commented 4 years ago

No without rewriting the hash function.

flx is somewhat case-sensitive. If you search for Lo, then log gives a 0 score. This is consistent with Emacs behavior, where searching (C-s) for lo finds both log and Log, but searching for Lo finds Log only.

flx does this intentionally (see function flx-get-hash-for-string).

jcs090218 commented 4 years ago

I guess is a feature!? :)

I am fine with it. Close this now! Thanks! 😄