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:
committed by
Bram Moolenaar
parent
e2bd8600b8
commit
360da40b47
@@ -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
|
||||
|
Reference in New Issue
Block a user