Created
June 5, 2014 17:30
-
-
Save ichizok/ff37b16576321b287b0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/regexp.c b/src/regexp.c | |
--- a/src/regexp.c | |
+++ b/src/regexp.c | |
@@ -3109,16 +3109,25 @@ | |
if (reg_magic >= MAGIC_OFF) | |
{ | |
char_u *p = regparse + 1; | |
- | |
- /* ignore \c \C \m and \M after '$' */ | |
+ int is_magic_all = (reg_magic == MAGIC_ALL) ? TRUE : FALSE; | |
+ | |
+ /* ignore \c \C \m \M \v \V and \Z after '$' */ | |
while (p[0] == '\\' && (p[1] == 'c' || p[1] == 'C' | |
- || p[1] == 'm' || p[1] == 'M' || p[1] == 'Z')) | |
+ || p[1] == 'm' || p[1] == 'M' | |
+ || p[1] == 'v' || p[1] == 'V' || p[1] == 'Z')) | |
+ { | |
+ if (p[1] == 'v' && is_magic_all != TRUE) | |
+ is_magic_all = TRUE; | |
+ else if ((p[1] == 'm' || p[1] == 'M' || p[1] == 'V') | |
+ && is_magic_all == TRUE) | |
+ is_magic_all = FALSE; | |
p += 2; | |
+ } | |
if (p[0] == NUL | |
|| (p[0] == '\\' | |
&& (p[1] == '|' || p[1] == '&' || p[1] == ')' | |
|| p[1] == 'n')) | |
- || reg_magic == MAGIC_ALL) | |
+ || is_magic_all == TRUE) | |
curchr = Magic('$'); | |
} | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment