Skip to content
Myr

🐛 Fix sort order regression from 1.14.0

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixes #730

authored by Mark Stosberg · committed by Daniel Eklöf · parent 3ea0973 · Browse files · 3 files+16 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+16 added−5 removed

  • tests:+6 added−0 removed
  • other:+10 added−5 removed

3 files+16 added−5 removed

modified:test/match-mode-fzf.fish+6 added
18 unmodified lines
1920test_fzf_mode "hamburger\nflag: bulgaria\nbug\njunk\ntrunk" bug21@test "exact matches should rank higher than fuzzy matches" $got = bug2223test_fzf_mode "Checks color contrast between text and background: https://snook.ca/technical/colour_contrast/colour.html\nhttps://chatgpt.com\n" chatgpt24@test "longer contiguous match should rank higher (chatgpt)" $got = 'https://chatgpt.com'2526test_fzf_mode "OpenJDK 21 for x86_64\nFirefox\n" fox27@test "longer contiguous match should rank higher (firefox)" $got = Firefox2829test_fzf_mode "longer entry\nlonger\nlong" long30@test "shorter matches should match first" $got = long3132test_fzf_mode "\nbcdef\nabcd\n" cd
4 unmodified lines
modified:CHANGELOG.md+5 added
41 unmodified lines
42* Removed statement that Cairo is required for rounded corners. This43 is no longer true.44* Segfault when attempting to parse a comment in an icon `index.theme` file45 and correctly interpreting KV pairs by ignoring whitespace ([#727][727]).46* Fixed fzf-mode sorting regression in 1.14.0. ([#730][730])4748[727]: https://codeberg.org/dnkl/fuzzel/pulls/72749[730]: https://codeberg.org/dnkl/fuzzel/issues/730505152### Security53### Contributors5455* tranzystorekk56* Rahul Sandhu57* markstos58* VegOwOtenks59* mb720606162## 1.14.063
1116 unmodified lines
modified:match.c+5 added-5 removed
821 unmodified lines
822 else823 return 1;824 }825826 /* Prioritize matches at word boundaries */827 if (a->word_boundary != b->word_boundary) {828 return a->word_boundary ? -1 : 1;829 }830 else if (a->score > b->score)826 if (a->score > b->score)827 return -1;828 else if (a->score < b->score)829 return 1;830 /* Prioritize matches at word boundaries (when scores are equal) */831 else if (a->word_boundary != b->word_boundary) {832 return a->word_boundary ? -1 : 1;833 }834 else if (a->pos_count < b->pos_count)835 return -1;836 else if (a->pos_count > b->pos_count)837 return 1;
909 unmodified lines