20
850
Fork
You've already forked fuzzel
83

Favour matches at word boundaries #695

Closed
opened 2025年10月21日 15:10:57 +02:00 by ccjmne · 2 comments

Pre-checks

Describe your feature request

Say that I have Microsoft Teams and Steam running, when I search for teams, I'd like Microsoft Teams to show up before I finish typing the 5th character (the s of teams, my input) that would unequivocally match the Microsoft Teams result instead of Steam.

I believe that prioritising matches at word boundaries would be appropriate.

Note that currently, setting the match-mode to fzf doesn't replicate that specific behaviour of the default fzf matching algorithm. Here's a shell snippet you can play with to see for yourself:

fuzzel --match-mode fzf --dmenu <<EOF
Steam
Microsoft Teams
EOF
fuzzel --match-mode fzf --dmenu <<EOF
Microsoft Teams
Steam
EOF

Do similar tools already implement this feature?

Yes, fzf and tofi do it by default.

Here's two quick copy-pastable excerpts to observe how either behaves:

fzf <<EOF
Steam
Microsoft Teams
EOF
fzf <<EOF
Microsoft Teams
Steam
EOF
tofi --fuzzy true <<EOF
Steam
Microsoft Teams
EOF
tofi --fuzzy true <<EOF
Microsoft Teams
Steam
EOF

Regardless of the order in which the two results are listed originally, merely typing "tea" will favour Microsoft Teams right away with both tools.

Well, technically, I only tested the beginning of words rather than both their ends, but I suppose this to be the more prominent use case.

### Pre-checks - [x] The [fuzzel.ini](https://codeberg.org/dnkl/fuzzel/src/branch/master/doc/fuzzel.ini.5.scd) and [fuzzel](https://codeberg.org/dnkl/fuzzel/src/branch/master/doc/fuzzel.1.scd) man pages. - [x] [Changelog](https://codeberg.org/dnkl/fuzzel/src/branch/master/CHANGELOG.md#unreleased) of newer and unreleased features ### Describe your feature request Say that I have `Microsoft Teams` and `Steam` running, when I search for `teams`, I'd like `Microsoft Teams` to show up before I finish typing the 5th character (the `s` of `teams`, my input) that would unequivocally match the `Microsoft Teams` result instead of `Steam`. **I believe that prioritising matches at word boundaries would be appropriate.** Note that currently, setting the `match-mode` to `fzf` doesn't replicate that specific behaviour of the default `fzf` matching algorithm. Here's a shell snippet you can play with to see for yourself: ```sh fuzzel --match-mode fzf --dmenu <<EOF Steam Microsoft Teams EOF fuzzel --match-mode fzf --dmenu <<EOF Microsoft Teams Steam EOF ``` ### Do similar tools already implement this feature? Yes, `fzf` and `tofi` do it by default. Here's two quick copy-pastable excerpts to observe how either behaves: ```sh fzf <<EOF Steam Microsoft Teams EOF fzf <<EOF Microsoft Teams Steam EOF ``` ```sh tofi --fuzzy true <<EOF Steam Microsoft Teams EOF tofi --fuzzy true <<EOF Microsoft Teams Steam EOF ``` Regardless of the order in which the two results are listed originally, merely typing "tea" will favour `Microsoft Teams` right away with both tools. Well, technically, I only tested the *beginning* of words rather than both their ends, but I suppose this to be the more prominent use case.
ccjmne changed title from (削除) Have the fuzzy algorithm favour matches at word boundaries (削除ここまで) to Favour matches at word boundaries 2025年10月21日 15:28:03 +02:00
Collaborator
Copy link

I agree fzf's behavior is better here and have submitted a PR to align with it.

I agree fzf's behavior is better here and have submitted a PR to align with it.
Author
Copy link

Fantastic, thank you very much, @markstos!

Fantastic, thank you very much, @markstos!
dnkl referenced this issue from a commit 2026年01月28日 08:53:57 +01:00
Sign in to join this conversation.
No Branch/Tag specified
master
gnome-support
releases/1.14
issue-319-window-switching
issue-561-nord-theme-only
resvg-filtering-take-2
resvg-filtering
releases/1.13
rehanzo-dont-ignore-execute-648
keybinds-overwrite
issue-561-refresh-theme
ci-automated-testing
reenable-legacy-icons
releases/1.12
test-coverage-for-fzf-caching
releases/1.11
releases/1.10
releases/1.9
releases/1.8
releases/1.7
releases/1.6
releases/1.5
releases/1.4
releases/1.3
releases/1.2
releases/1.1
releases/1.0
1.14.1
1.14.0
1.13.1
1.13.0
1.12.0
1.11.1
1.11.0
1.10.2
1.10.1
1.10.0
1.9.2
1.9.1
1.9.0
1.8.2
1.8.1
1.8.0
1.7.0
1.6.5
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.2
1.4.1
1.4.0
1.3.0
1.2.0
1.1.0
1.0.1
1.0.0
0.9.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/fuzzel#695
Reference in a new issue
dnkl/fuzzel
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?