aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-28 18:15:41 +0800
committerGitHub <noreply@github.com>2024-03-28 18:15:41 +0800
commit6364fc617ded29100c1aa3103e189fd983dd5e64 (patch)
treecb5a635a8f2298adfe1531933d9037001b61fc81 /test
parentc804d7968bb54eaac240e879346e7ad55a03b77b (diff)
downloadrneovim-6364fc617ded29100c1aa3103e189fd983dd5e64.tar.gz
rneovim-6364fc617ded29100c1aa3103e189fd983dd5e64.tar.bz2
rneovim-6364fc617ded29100c1aa3103e189fd983dd5e64.zip
vim-patch:9.1.0217: regexp: verymagic cannot match before/after a mark (#28074)
Problem: regexp: verymagic cannot match before/after a mark Solution: Correctly check for the very magic check (Julio B) Fix regexp parser for \v%>'m and \v%<'m Currently \v%'m works fine, but it is unable to match before or after the position of mark m. closes: vim/vim#14309 https://github.com/vim/vim/commit/46fa3c7e271eb2abb05a0d9e6dbc9c36c2b2da02 Co-authored-by: Julio B <julio.bacel@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_regexp_latin.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/old/testdir/test_regexp_latin.vim b/test/old/testdir/test_regexp_latin.vim
index ece6ae518e..62771c9743 100644
--- a/test/old/testdir/test_regexp_latin.vim
+++ b/test/old/testdir/test_regexp_latin.vim
@@ -842,12 +842,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