mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.0887: the 'l' flag in :subsitute is sticky
Problem: The 'l' flag in :subsitute is sticky.
Solution: Reset the flag. (Dominique Pelle, closes vim/vim#3925)
9474716d39
This commit is contained in:
parent
2470c88291
commit
2894d04b19
@ -3181,6 +3181,7 @@ static char_u *sub_parse_flags(char_u *cmd, subflags_T *subflags,
|
||||
subflags->do_ask = false;
|
||||
subflags->do_error = true;
|
||||
subflags->do_print = false;
|
||||
subflags->do_list = false;
|
||||
subflags->do_count = false;
|
||||
subflags->do_number = false;
|
||||
subflags->do_ic = kSubHonorOptions;
|
||||
|
@ -107,6 +107,32 @@ function! Test_substitute_variants()
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Test the l, p, # flags.
|
||||
func Test_substitute_flags_lp()
|
||||
new
|
||||
call setline(1, "abc\tdef\<C-h>ghi")
|
||||
|
||||
let a = execute('s/a/a/p')
|
||||
call assert_equal("\nabc def^Hghi", a)
|
||||
|
||||
let a = execute('s/a/a/l')
|
||||
call assert_equal("\nabc^Idef^Hghi$", a)
|
||||
|
||||
let a = execute('s/a/a/#')
|
||||
call assert_equal("\n 1 abc def^Hghi", a)
|
||||
|
||||
let a = execute('s/a/a/p#')
|
||||
call assert_equal("\n 1 abc def^Hghi", a)
|
||||
|
||||
let a = execute('s/a/a/l#')
|
||||
call assert_equal("\n 1 abc^Idef^Hghi$", a)
|
||||
|
||||
let a = execute('s/a/a/')
|
||||
call assert_equal("", a)
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_substitute_repeat()
|
||||
" This caused an invalid memory access.
|
||||
split Xfile
|
||||
|
Loading…
Reference in New Issue
Block a user