aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2014-10-25 15:34:06 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-11-13 11:38:19 -0500
commitca7c509ae0396be0b15c268b1b2e0600e796e322 (patch)
treea8458ee422ca0803bacba0831f3de0ef44c4c2f7 /src
parent44635add18f7ef49f8d598123ec1d4ec61563e73 (diff)
downloadrneovim-ca7c509ae0396be0b15c268b1b2e0600e796e322.tar.gz
rneovim-ca7c509ae0396be0b15c268b1b2e0600e796e322.tar.bz2
rneovim-ca7c509ae0396be0b15c268b1b2e0600e796e322.zip
vim-patch:7.4.437
Problem: New and old regexp engine are not consistent. Solution: Also give an error for "\ze*" for the old regexp engine. https://code.google.com/p/vim/source/detail?r=v7-4-437
Diffstat (limited to 'src')
-rw-r--r--src/nvim/regexp.c15
-rw-r--r--src/nvim/regexp_nfa.c9
-rw-r--r--src/nvim/version.c2
3 files changed, 16 insertions, 10 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index cef2e6d9bf..d57bc889ac 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -1983,9 +1983,15 @@ static char_u *regatom(int *flagp)
break;
case 's': ret = regnode(MOPEN + 0);
+ if (!re_mult_next("\\zs")) {
+ return NULL;
+ }
break;
case 'e': ret = regnode(MCLOSE + 0);
+ if (!re_mult_next("\\ze")) {
+ return NULL;
+ }
break;
default: EMSG_RET_NULL(_("E68: Invalid character after \\z"));
@@ -2460,6 +2466,15 @@ do_multibyte:
return ret;
}
+/// Used in a place where no * or \+ can follow.
+static bool re_mult_next(char *what)
+{
+ if (re_multi_type(peekchr()) == MULTI_MULT) {
+ EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
+ }
+ return true;
+}
+
/*
* Return TRUE if MULTIBYTECODE should be used instead of EXACTLY for
* character "c".
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index bbe96854ad..9ae1740627 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -1747,15 +1747,6 @@ nfa_do_multibyte:
return OK;
}
-/// Used in a place where no * or \+ can follow.
-static bool re_mult_next(char *what)
-{
- if (re_multi_type(peekchr()) == MULTI_MULT) {
- EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
- }
- return true;
-}
-
/*
* Parse something followed by possible [*+=].
*
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 76cf667ce5..2bc99fcad4 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -228,7 +228,7 @@ static int included_patches[] = {
440,
439,
//438,
- //437,
+ 437,
436,
//435,
//434,