mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.1.0351: 'incsearch' for :/foo/s//<Esc> changes last search pattern
Problem: 'incsearch' for :/foo/s//<Esc> changes last search pattern. Solution: Save the last search pattern earlier.
This commit is contained in:
@@ -1043,6 +1043,23 @@ func Test_incsearch_vimgrep_dump()
|
||||
call delete('Xis_vimgrep_script')
|
||||
endfunc
|
||||
|
||||
func Test_keep_last_search_pattern()
|
||||
if !exists('+incsearch')
|
||||
return
|
||||
endif
|
||||
new
|
||||
call setline(1, ['foo', 'foo', 'foo'])
|
||||
set incsearch
|
||||
call test_override("char_avail", 1)
|
||||
let @/ = 'bar'
|
||||
call feedkeys(":/foo/s//\<Esc>", 'ntx')
|
||||
call assert_equal('bar', @/)
|
||||
|
||||
bwipe!
|
||||
call test_override("ALL", 0)
|
||||
set noincsearch
|
||||
endfunc
|
||||
|
||||
func Test_search_undefined_behaviour()
|
||||
if !has("terminal")
|
||||
return
|
||||
|
Reference in New Issue
Block a user