@@ -71,7 +71,7 @@ public MatchResult FuzzyMatch(string query, string stringToCompare, MatchOption
71
71
|| ( char . IsWhiteSpace ( c ) && char . ToLower ( stringToCompare [ ++ compareIndex ] ) ==
72
72
queryWithoutCase [ currentQueryIndex ] )
73
73
|| ( char . IsNumber ( c ) && c == queryWithoutCase [ currentQueryIndex ] ) :
74
- acronymMatchData . Add ( map ? . MapToOriginalIndex ( compareIndex ) ?? compareIndex ) ;
74
+ acronymMatchData . Add ( compareIndex ) ;
75
75
currentQueryIndex ++ ;
76
76
continue ;
77
77
@@ -86,7 +86,10 @@ public MatchResult FuzzyMatch(string query, string stringToCompare, MatchOption
86
86
}
87
87
88
88
if ( acronymMatchData . Count == query . Length && acronymScore >= 60 )
89
+ {
90
+ acronymMatchData = acronymMatchData . Select ( x => map ? . MapToOriginalIndex ( x ) ?? x ) . Distinct ( ) . ToList ( ) ;
89
91
return new MatchResult ( true , UserSettingSearchPrecision , acronymMatchData , acronymScore ) ;
92
+ }
90
93
91
94
var fullStringToCompareWithoutCase = opt . IgnoreCase ? stringToCompare . ToLower ( ) : stringToCompare ;
92
95
@@ -188,7 +191,7 @@ public MatchResult FuzzyMatch(string query, string stringToCompare, MatchOption
188
191
var score = CalculateSearchScore ( query , stringToCompare , firstMatchIndex - nearestSpaceIndex - 1 ,
189
192
lastMatchIndex - firstMatchIndex , allSubstringsContainedInCompareString ) ;
190
193
191
- var resultList = indexList . Distinct ( ) . Select ( x => map ? . MapToOriginalIndex ( x ) ?? x ) . ToList ( ) ;
194
+ var resultList = indexList . Select ( x => map ? . MapToOriginalIndex ( x ) ?? x ) . Distinct ( ) . ToList ( ) ;
192
195
return new MatchResult ( true , UserSettingSearchPrecision , resultList , score ) ;
193
196
}
194
197
0 commit comments