nimgrep: fixes the -w option

(cherry picked from commit f7c99838e2)
This commit is contained in:
Andreas Rumpf
2019-07-24 21:46:44 +02:00
committed by narimiran
parent 69c2341663
commit d9fd01af88

View File

@@ -342,7 +342,7 @@ else:
if optIgnoreStyle in options:
pattern = styleInsensitive(pattern)
if optWord in options:
pattern = r"\b (:?" & pattern & r") \b"
pattern = r"\b(:?" & pattern & r")\b"
if {optIgnoreCase, optIgnoreStyle} * options != {}:
reflags.incl reIgnoreCase
let rep = re(pattern, reflags)