aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-05 15:59:17 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-05 16:09:22 +0800
commitb84666d2a0dc4a7585ef6aa5a8f9060046ff9082 (patch)
tree5b4486c9e051e62b7b52cc016624e7e9526c8e6e /src/nvim/testdir
parent77e25e56d8ccc0c174305f9fe64ad06f0223ab2d (diff)
downloadrneovim-b84666d2a0dc4a7585ef6aa5a8f9060046ff9082.tar.gz
rneovim-b84666d2a0dc4a7585ef6aa5a8f9060046ff9082.tar.bz2
rneovim-b84666d2a0dc4a7585ef6aa5a8f9060046ff9082.zip
vim-patch:8.2.4978: no error if engine selection atom is not at the start
Problem: No error if engine selection atom is not at the start. Solution: Give an error. (Christian Brabandt, closes vim/vim#10439) https://github.com/vim/vim/commit/360da40b47a84ee8586c3b5d062f8c64a2ac9cc6 Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_regexp_latin.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_regexp_latin.vim b/src/nvim/testdir/test_regexp_latin.vim
index 5312c6f26a..3a4a7ad910 100644
--- a/src/nvim/testdir/test_regexp_latin.vim
+++ b/src/nvim/testdir/test_regexp_latin.vim
@@ -1058,6 +1058,24 @@ func Test_using_invalid_visual_position()
bwipe!
endfunc
+func Test_using_two_engines_pattern()
+ new
+ call setline(1, ['foobar=0', 'foobar=1', 'foobar=2'])
+ " \%#= at the end of the pattern
+ for i in range(0, 2)
+ call cursor( (i+1), 7)
+ call assert_fails("%s/foobar\\%#=" .. i, 'E1281:')
+ endfor
+
+ " \%#= at the start of the pattern
+ for i in range(0, 2)
+ call cursor( (i+1), 7)
+ exe ":%s/\\%#=" .. i .. "foobar=" .. i .. "/xx"
+ endfor
+ call assert_equal(['xx', 'xx', 'xx'], getline(1, '$'))
+ bwipe!
+endfunc
+
func Test_recursive_substitute_expr()
new
func Repl()