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
This commit is contained in:
Junegunn Choi 2022-12-04 22:14:11 +09:00
parent 3f079ba7c6
commit 6b207bbf2b
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
2 changed files with 2 additions and 2 deletions

View File

@ -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
------

View File

@ -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))
}