Fix inconsistent bonus points in exact match

Exact match would assign a different bonus point to the first character
when non-default --scheme was used.

Fix #3073
pull/3093/head
Junegunn Choi 1 year ago
parent 3f079ba7c6
commit 6b207bbf2b
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -9,7 +9,7 @@ CHANGELOG
# No need to bind 'double-click' to the same action
fzf --bind 'enter:execute:less {}' # --bind 'double-click:execute:less {}'
```
- Minor rendering improvements
- Minor bug fixes and improvements
0.35.1
------

@ -617,7 +617,7 @@ func FuzzyMatchV2(caseSensitive bool, normalize bool, forward bool, input *util.
func calculateScore(caseSensitive bool, normalize bool, text *util.Chars, pattern []rune, sidx int, eidx int, withPos bool) (int, *[]int) {
pidx, score, inGap, consecutive, firstBonus := 0, 0, false, 0, int16(0)
pos := posArray(withPos, len(pattern))
prevClass := charWhite
prevClass := initialCharClass
if sidx > 0 {
prevClass = charClassOf(text.Get(sidx - 1))
}

Loading…
Cancel
Save