make fuzzy search a bit less fuzzy (#13996) [backport:1.2]
This commit is contained in:
parent
6914de0d8d
commit
06e0c75ba9
2 changed files with 4 additions and 1 deletions
|
|
@ -132,6 +132,9 @@ proc fuzzyMatch*(pattern, str: cstring) : tuple[score: int, matched: bool] =
|
|||
|
||||
strIndex += 1
|
||||
|
||||
if patIndex == pattern.len and (strIndex == str.len or str[strIndex] notin Letters):
|
||||
score += 10
|
||||
|
||||
result = (
|
||||
score: max(0, score),
|
||||
matched: (score > 0),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue