diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-08-11 16:40:43 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-08-11 16:40:43 +0200 |
commit | b0acacd767a2b0618a7f3c08087708f4329580d0 (patch) | |
tree | 9154e5f4fb75605e0342e90c53b4e529b05fc621 /src/testdir/test_search.vim | |
parent | b31a3acce13231643b006988c1ce76b8a12b2982 (diff) |
patch 8.1.0271: 'incsearch' doesn't work for :s, :g or :vv8.1.0271
Problem: 'incsearch' doesn't work for :s, :g or :v.
Solution: Also use 'incsearch' for other commands that use a pattern.
Diffstat (limited to 'src/testdir/test_search.vim')
-rw-r--r-- | src/testdir/test_search.vim | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim index 28f0463c40..71de172dc9 100644 --- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -362,6 +362,58 @@ func Test_search_cmdline3() bw! endfunc +func Cmdline3_prep() + " need to disable char_avail, + " so that expansion of commandline works + call test_override("char_avail", 1) + new + call setline(1, [' 1', ' 2 the~e', ' 3 the theother']) + set incsearch +endfunc + +func Cmdline3_cleanup() + set noincsearch + call test_override("char_avail", 0) + bw! +endfunc + +func Test_search_cmdline3s() + if !exists('+incsearch') + return + endif + call Cmdline3_prep() + 1 + call feedkeys(":%s/the\<c-l>/xxx\<cr>", 'tx') + call assert_equal(' 2 xxxe', getline('.')) + + call Cmdline3_cleanup() +endfunc + +func Test_search_cmdline3g() + if !exists('+incsearch') + return + endif + call Cmdline3_prep() + 1 + call feedkeys(":g/the\<c-l>/d\<cr>", 'tx') + call assert_equal(' 3 the theother', getline(2)) + + call Cmdline3_cleanup() +endfunc + +func Test_search_cmdline3v() + if !exists('+incsearch') + return + endif + call Cmdline3_prep() + 1 + call feedkeys(":v/the\<c-l>/d\<cr>", 'tx') + call assert_equal(1, line('$')) + call assert_equal(' 2 the~e', getline(1)) + + call Cmdline3_cleanup() +endfunc + func Test_search_cmdline4() if !exists('+incsearch') return |