diff options
Diffstat (limited to 'tools/dochack/fuzzysearch.nim')
-rw-r--r-- | tools/dochack/fuzzysearch.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/dochack/fuzzysearch.nim b/tools/dochack/fuzzysearch.nim index 05f61bc11..fecbaf4f0 100644 --- a/tools/dochack/fuzzysearch.nim +++ b/tools/dochack/fuzzysearch.nim @@ -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), |