summaryrefslogtreecommitdiffstats
path: root/src/algo
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2022-12-04 22:14:11 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2022-12-04 22:17:39 +0900
commit6b207bbf2bd916d06586cdbbf980ae507c01f2b2 (patch)
tree549857f8c08b97455f59f4421a6e392da9f11ab4 /src/algo
parent3f079ba7c6d5a95f69699422329e9c5150002448 (diff)
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
Diffstat (limited to 'src/algo')
-rw-r--r--src/algo/algo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/algo/algo.go b/src/algo/algo.go
index 50dd466c..ba09dc50 100644
--- a/src/algo/algo.go
+++ b/src/algo/algo.go
@@ -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))
}