diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/regexp_bt.c | 2 | ||||
-rw-r--r-- | src/regexp_nfa.c | 2 | ||||
-rw-r--r-- | src/testdir/test_regexp_latin.vim | 14 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/regexp_bt.c b/src/regexp_bt.c index 198946e0dc..5d9450d871 100644 --- a/src/regexp_bt.c +++ b/src/regexp_bt.c @@ -1641,7 +1641,7 @@ regatom(int *flagp) n = n * 10 + (c - '0'); c = getchr(); } - if (c == '\'' && n == 0) + if (no_Magic(c) == '\'' && n == 0) { // "\%'m", "\%<'m" and "\%>'m": Mark c = getchr(); diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index ff54348905..359ce5b517 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -1733,7 +1733,7 @@ nfa_regatom(void) EMIT((int)n); break; } - else if (c == '\'' && n == 0) + else if (no_Magic(c) == '\'' && n == 0) { // \%'m \%<'m \%>'m EMIT(cmp == '<' ? NFA_MARK_LT : diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim index 9acb12b4af..f8614e7d18 100644 --- a/src/testdir/test_regexp_latin.vim +++ b/src/testdir/test_regexp_latin.vim @@ -874,12 +874,26 @@ func Regex_Mark() %d endfunc +" Same test as abobe, but use verymagic +func Regex_Mark_Verymagic() + call append(0, ['', '', '', 'Marks:', 'asdfSasdfsadfEasdf', 'asdfSas', + \ 'dfsadfEasdf', '', '', '', '', '']) + call cursor(4, 1) + exe "normal jfSmsfEme:.-4,.+6s/\\v.%>'s.*%<'e../here/\<CR>" + exe "normal jfSmsj0fEme:.-4,.+6s/\\v.%>'s\\_.*%<'e../again/\<CR>" + call assert_equal(['', '', '', 'Marks:', 'asdfhereasdf', 'asdfagainasdf', + \ '', '', '', '', '', ''], getline(1, '$')) + %d +endfunc + func Test_matching_marks() new set regexpengine=1 call Regex_Mark() + call Regex_Mark_Verymagic() set regexpengine=2 call Regex_Mark() + call Regex_Mark_Verymagic() bwipe! endfunc |