From 3fafd546d5a8d9f41ac4ecbe0b154b2adde09305 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sun, 19 Mar 2017 13:00:24 +0100 Subject: [PATCH] nimsuggest: prefixes of abbreviations don't count --- compiler/prefixmatches.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/prefixmatches.nim b/compiler/prefixmatches.nim index 9805fdbd2a..00e2c537d0 100644 --- a/compiler/prefixmatches.nim +++ b/compiler/prefixmatches.nim @@ -50,7 +50,10 @@ proc prefixMatch*(p, s: string): PrefixMatch = if j < p.len and eq(p[j], s[i]): inc j else: return PrefixMatch.None inc i - return PrefixMatch.Abbrev + if j >= p.len: + return PrefixMatch.Abbrev + else: + return PrefixMatch.None return PrefixMatch.None when isMainModule: @@ -84,3 +87,4 @@ when isMainModule: check PrefixMatch.None: ("foobar", "afkslfjd_as") ("xyz", "X_yuuZuuZe") + ("ru", "remotes")