Bugfix for fuzzysearch found by Zevv here: https://irclogs.nim-lang.org/28-09-2018.html#19:43:52
This commit is contained in:
parent
49291f3758
commit
8e258d3e8a
1 changed files with 1 additions and 1 deletions
|
|
@ -86,7 +86,7 @@ proc fuzzyMatch*(pattern, str: cstring) : tuple[score: int, matched: bool] =
|
||||||
score += ord(LeadingCharMatch)
|
score += ord(LeadingCharMatch)
|
||||||
|
|
||||||
var onBoundary = (patIndex == high(pattern))
|
var onBoundary = (patIndex == high(pattern))
|
||||||
if not onBoundary:
|
if not onBoundary and strIndex < high(str):
|
||||||
let
|
let
|
||||||
nextPatternChar = toLowerAscii(pattern[patIndex + 1])
|
nextPatternChar = toLowerAscii(pattern[patIndex + 1])
|
||||||
nextStrChar = toLowerAscii(str[strIndex + 1])
|
nextStrChar = toLowerAscii(str[strIndex + 1])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue