Skip to content
Browse files

\\b in a pattern isn't \b

Require the start of line or any character not a slash before a \b to be
translated into vim's syntax.  Technically not 100% correct as it'll
false negative on \\\b, but that's OK for now.  I haven't run into it in
practice unlike the bug fixed by this change.
  • Loading branch information...
1 parent 8253ee7 commit 7d31a584ccaaf81ea307fea9439489b04be3789b @tsibley committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 viack
2 viack
@@ -12,7 +12,7 @@ for (@ARGV) {
# characters are < and >
my $vimpat = $_;
$vimpat =~ s{([<>=@!%/&])}{\\$1}g;
- $vimpat =~ s{\\b}{\\W\\@=}g; # translate Perl's \b to \W\@= for vim
+ $vimpat =~ s{(^|(?<=[^\\]))\\b}{\\W\\@=}g; # translate Perl's \b to \W\@= for vim
push @vimopts, '+1', '+/\v'.$vimpat;

0 comments on commit 7d31a58

Please sign in to comment.
Something went wrong with that request. Please try again.