comparison src/testdir/test_search.vim @ 14677:7771a1ff8b99 v8.1.0351

patch 8.1.0351: 'incsearch' for :/foo/s//<Esc> changes last search pattern commit https://github.com/vim/vim/commit/198cb66d652d3d8ac16226dcc929a11b0b720151 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 6 21:44:17 2018 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Thu, 06 Sep 2018 21:45:05 +0200
parents f3b183c3d3e2
children 2982a54aa304
comparison
equal deleted inserted replaced
14676:fb44828733f7 14677:7771a1ff8b99
1041 1041
1042 call StopVimInTerminal(buf) 1042 call StopVimInTerminal(buf)
1043 call delete('Xis_vimgrep_script') 1043 call delete('Xis_vimgrep_script')
1044 endfunc 1044 endfunc
1045 1045
1046 func Test_keep_last_search_pattern()
1047 if !exists('+incsearch')
1048 return
1049 endif
1050 new
1051 call setline(1, ['foo', 'foo', 'foo'])
1052 set incsearch
1053 call test_override("char_avail", 1)
1054 let @/ = 'bar'
1055 call feedkeys(":/foo/s//\<Esc>", 'ntx')
1056 call assert_equal('bar', @/)
1057
1058 bwipe!
1059 call test_override("ALL", 0)
1060 set noincsearch
1061 endfunc
1062
1046 func Test_search_undefined_behaviour() 1063 func Test_search_undefined_behaviour()
1047 if !has("terminal") 1064 if !has("terminal")
1048 return 1065 return
1049 endif 1066 endif
1050 let h = winheight(0) 1067 let h = winheight(0)