mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-02-03 04:28:36 +00:00
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:
parent
3f079ba7c6
commit
6b207bbf2b
@ -9,7 +9,7 @@ CHANGELOG
|
|||||||
# No need to bind 'double-click' to the same action
|
# No need to bind 'double-click' to the same action
|
||||||
fzf --bind 'enter:execute:less {}' # --bind 'double-click:execute:less {}'
|
fzf --bind 'enter:execute:less {}' # --bind 'double-click:execute:less {}'
|
||||||
```
|
```
|
||||||
- Minor rendering improvements
|
- Minor bug fixes and improvements
|
||||||
|
|
||||||
0.35.1
|
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) {
|
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)
|
pidx, score, inGap, consecutive, firstBonus := 0, 0, false, 0, int16(0)
|
||||||
pos := posArray(withPos, len(pattern))
|
pos := posArray(withPos, len(pattern))
|
||||||
prevClass := charWhite
|
prevClass := initialCharClass
|
||||||
if sidx > 0 {
|
if sidx > 0 {
|
||||||
prevClass = charClassOf(text.Get(sidx - 1))
|
prevClass = charClassOf(text.Get(sidx - 1))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user