From 6b207bbf2bd916d06586cdbbf980ae507c01f2b2 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 4 Dec 2022 22:14:11 +0900 Subject: 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 --- src/algo/algo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/algo') 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)) } -- cgit v1.2.3