summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2013-06-13 20:19:40 +0200
committerBram Moolenaar <bram@vim.org>2013-06-13 20:19:40 +0200
commitf6f41a59ba529af790e30eb7276fe7816f6e1242 (patch)
tree1b0643eff27fe26340b3c96f6d7aa8c401a4d655
parent5679e08104f31da53674e4bf414864dbc49fb278 (diff)
downloadvim-f6f41a59ba529af790e30eb7276fe7816f6e1242.tar.gz
updated for version 7.3.1185v7.3.1185v7-3-1185
Problem: New regexp engine: no match with ^ after \n. (SungHyun Nam) Solution: Fix it, add a test.
-rw-r--r--src/regexp_nfa.c5
-rw-r--r--src/testdir/test64.in11
-rw-r--r--src/testdir/test64.ok2
-rw-r--r--src/version.c2
4 files changed, 18 insertions, 2 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 780653f0..20f7aa31 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -3936,9 +3936,10 @@ addstate(l, state, subs, pim, off)
case NFA_BOL:
case NFA_BOF:
/* "^" won't match past end-of-line, don't bother trying.
- * Except when we are going to the next line for a look-behind
- * match. */
+ * Except when at the end of the line, or when we are going to the
+ * next line for a look-behind match. */
if (reginput > regline
+ && *reginput != NUL
&& (nfa_endp == NULL
|| !REG_MULTI
|| reglnum == nfa_endp->se_u.pos.lnum))
diff --git a/src/testdir/test64.in b/src/testdir/test64.in
index 8100436f..51cdb31e 100644
--- a/src/testdir/test64.in
+++ b/src/testdir/test64.in
@@ -480,6 +480,12 @@ Gop:"
:.yank
y$Gop:"
:"
+:" Check a pattern with a line break and ^ and $
+/^Abc:
+/a\n^b$\n^c/e
+:.yank
+Gop:"
+:"
:" Check a pattern with a look beind crossing a line boundary
/^Behind:
/\(<\_[xy]\+\)\@3<=start
@@ -555,6 +561,11 @@ ghi
xjk
lmn
+Abc:
+a
+b
+c
+
Behind:
asdfasd<yyy
xxstart1
diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok
index 8e90cb8f..20725dde 100644
--- a/src/testdir/test64.ok
+++ b/src/testdir/test64.ok
@@ -918,6 +918,8 @@ OK 2 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12}
<T="7">Ac 7</Title>
ghi
+c
+
xxstart3
thexE thE thExethe
diff --git a/src/version.c b/src/version.c
index f003bbc0..7f315b81 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1185,
+/**/
1184,
/**/
1183,