0
0
mirror of https://github.com/vim/vim.git synced 2025-10-05 05:34:07 -04:00

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 #10439)
This commit is contained in:
Christian Brabandt
2022-05-18 15:04:02 +01:00
committed by Bram Moolenaar
parent e2bd8600b8
commit 360da40b47
6 changed files with 39 additions and 1 deletions

View File

@@ -1096,4 +1096,22 @@ 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
" vim: shiftwidth=2 sts=2 expandtab