mirror of
https://github.com/neovim/neovim.git
synced 2026-08-27 17:41:48 +00:00
vim-patch:9.1.0438: Wrong Ex command executed when :g uses '?' as delimiter (#28956)
Problem: Wrong Ex command executed when :g uses '?' as delimiter and
pattern contains escaped '?'.
Solution: Don't use "*newp" when it's not allocated (zeertzjq).
closes: vim/vim#14837
3074137542
This commit is contained in:
@@ -96,7 +96,16 @@ func Test_global_newline()
|
||||
close!
|
||||
endfunc
|
||||
|
||||
func Test_wrong_delimiter()
|
||||
" Test :g with ? as delimiter.
|
||||
func Test_global_question_delimiter()
|
||||
new
|
||||
call setline(1, ['aaaaa', 'b?bbb', 'ccccc', 'ddd?d', 'eeeee'])
|
||||
g?\??delete
|
||||
call assert_equal(['aaaaa', 'ccccc', 'eeeee'], getline(1, '$'))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_global_wrong_delimiter()
|
||||
call assert_fails('g x^bxd', 'E146:')
|
||||
endfunc
|
||||
|
||||
|
||||
@@ -174,8 +174,8 @@ func Test_substitute_repeat()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test :s with ? as separator.
|
||||
func Test_substitute_question_separator()
|
||||
" Test :s with ? as delimiter.
|
||||
func Test_substitute_question_delimiter()
|
||||
new
|
||||
call setline(1, '??:??')
|
||||
%s?\?\??!!?g
|
||||
|
||||
Reference in New Issue
Block a user