Hi Axel!
On Sa, 17 Jan 2015, Axel Bender wrote:
> 1) Open the attached file "test.txt".
> 2) set ts=80
> 3) /\%>80vGesamtausabe
I apologize for causing this.
Here is a fix (including a test).
Best,
Christian
--
Man braucht nicht geistreich zu sein, um zu beweisen, daß man begabt
ist. Aber man braucht viel Geist, um zu verbergen, daß man keine
Begabung hat.
-- Marcel Achard
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -5414,6 +5414,7 @@ nfa_regmatch(prog, start, submatch, m)
int add_count;
int add_off = 0;
int toplevel = start->c == NFA_MOPEN;
+ int vcol_prev = 0;
#ifdef NFA_REGEXP_DEBUG_LOG
FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a");
@@ -6445,17 +6446,20 @@ nfa_regmatch(prog, start, submatch, m)
/* Bail out quickly when there can't be a match, avoid the
* overhead of win_linetabsize() on long lines. */
- if ((col > t->state->val && op != 1)
- || (col - 1 > t->state->val && op == 1))
+ if ((col > t->state->val && op != 1))
break;
- result = nfa_re_num_cmp(t->state->val, op,
- (long_u)win_linetabsize(
- reg_win == NULL ? curwin : reg_win,
- regline, col) + 1);
+ if (col - 1 > t->state->val && op == 1 && vcol_prev && col > vcol_prev)
+ result = TRUE;
+ else
+ result = nfa_re_num_cmp(t->state->val, op,
+ (long_u)win_linetabsize(reg_win == NULL ? curwin : reg_win, regline, col) + 1);
if (result)
{
add_here = TRUE;
add_state = t->state->out;
+ if (op == 1)
+ /* remember previous match column */
+ vcol_prev = col;
}
}
break;
diff --git a/src/testdir/test64.in b/src/testdir/test64.in
--- a/src/testdir/test64.in
+++ b/src/testdir/test64.in
@@ -7,6 +7,7 @@ actually tried.
STARTTEST
:so small.vim
:" tl is a List of Lists with:
+:" regexp engine
:" regexp pattern
:" text to test the pattern on
:" expected match (optional)
@@ -451,6 +452,9 @@ STARTTEST
:"""" Skip adding state twice
:call add(tl, [2, '^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=', "#if FOO", "#if", ' FOO'])
:"
+:""" Test \%V atom
+:call add(tl, [2, '\%>70vGesamt', 'Jean-Michel Charlier & Victor Hubinon\Gesamtausgabe [Salleck] Buck Danny {Jean-Michel Charlier & Victor Hubinon}\Gesamtausgabe', 'Gesamt'])
+:"
:"""" Run the tests
:"
:for t in tl
diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok
--- a/src/testdir/test64.ok
+++ b/src/testdir/test64.ok
@@ -1030,6 +1030,9 @@ OK 2 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}
OK 0 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=
OK 1 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=
OK 2 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=
+OK 0 - \%>70vGesamt
+OK 1 - \%>70vGesamt
+OK 2 - \%>70vGesamt
multi-line tests
OK 0 - ^.\(.\).\_..\1.
OK 1 - ^.\(.\).\_..\1.