nimgrep: fixes the -w option

This commit is contained in:
Andreas Rumpf
2019-07-24 21:46:44 +02:00
parent 25e6c53bb5
commit f7c99838e2

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)