hotfuzz icon indicating copy to clipboard operation
hotfuzz copied to clipboard

Is it expected to rank match at middle or end of word higher than start of word?

Open jn64 opened this issue 1 year ago • 1 comments
trafficstars

Version: 20240414.842 (melpa) Commit: 864d07cadb0ecbbf6c296db6ecfbb38358436e21 No dynamic module

(require 'hotfuzz)
(setopt completion-styles '(hotfuzz)
        completion-category-defaults nil
        completion-category-overrides nil)

Test 1, M-x fop TAB (uppercase indicates matched characters):

FOrward-sexP
FOrward-Page
...

Test 2, M-x dpk TAB:

Diff-sPlit-hunK
Diff-aPply-hunK
Describe-PacKage
Describe-Personal-Keybindings
...

This was surprising based on the description "ranks completions that match at word; path component; or camelCase boundaries higher."

At least in test 1, end of word is a boundary. But in test 2, I expected describe-personal-keybindings first.

jn64 avatar Aug 25 '24 11:08 jn64

This is not ideal, but it is due to there not being a gap at the end if the last characters of a completion are matched, and gaps being penalized the most. E.g.

FOrward-sexP
      1     gap
FOrward-Page
     1    2 gaps

axelf4 avatar Aug 27 '24 16:08 axelf4