diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-08-11 19:20:49 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-08-11 19:20:49 +0200 |
commit | 21f990e1c22ffa2fdb66a548ebbe25e6e7194776 (patch) | |
tree | 04ee8dbff5de3883ad951aec692b3ada5cf2563b /src/testdir/test_search.vim | |
parent | ef73a28401cde680dc0d02d4b0fb19ed659ec1d3 (diff) | |
download | vim-git-21f990e1c22ffa2fdb66a548ebbe25e6e7194776.tar.gz |
patch 8.1.0274: 'incsearch' triggers on ":source"v8.1.0274
Problem: 'incsearch' triggers on ":source".
Solution: Check for the whole command name.
Diffstat (limited to 'src/testdir/test_search.vim')
-rw-r--r-- | src/testdir/test_search.vim | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim index 71de172dc..7e8ddbe64 100644 --- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -342,26 +342,6 @@ func Test_searchc() bw! endfunc -func Test_search_cmdline3() - if !exists('+incsearch') - return - endif - " 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 - 1 - " first match - call feedkeys("/the\<c-l>\<cr>", 'tx') - call assert_equal(' 2 the~e', getline('.')) - " clean up - set noincsearch - call test_override("char_avail", 0) - bw! -endfunc - func Cmdline3_prep() " need to disable char_avail, " so that expansion of commandline works @@ -377,6 +357,19 @@ func Cmdline3_cleanup() bw! endfunc +func Test_search_cmdline3() + if !exists('+incsearch') + return + endif + call Cmdline3_prep() + 1 + " first match + call feedkeys("/the\<c-l>\<cr>", 'tx') + call assert_equal(' 2 the~e', getline('.')) + + call Cmdline3_cleanup() +endfunc + func Test_search_cmdline3s() if !exists('+incsearch') return @@ -385,6 +378,12 @@ func Test_search_cmdline3s() 1 call feedkeys(":%s/the\<c-l>/xxx\<cr>", 'tx') call assert_equal(' 2 xxxe', getline('.')) + undo + call feedkeys(":%subs/the\<c-l>/xxx\<cr>", 'tx') + call assert_equal(' 2 xxxe', getline('.')) + undo + call feedkeys(":%substitute/the\<c-l>/xxx\<cr>", 'tx') + call assert_equal(' 2 xxxe', getline('.')) call Cmdline3_cleanup() endfunc @@ -397,6 +396,9 @@ func Test_search_cmdline3g() 1 call feedkeys(":g/the\<c-l>/d\<cr>", 'tx') call assert_equal(' 3 the theother', getline(2)) + undo + call feedkeys(":global/the\<c-l>/d\<cr>", 'tx') + call assert_equal(' 3 the theother', getline(2)) call Cmdline3_cleanup() endfunc @@ -410,6 +412,10 @@ func Test_search_cmdline3v() call feedkeys(":v/the\<c-l>/d\<cr>", 'tx') call assert_equal(1, line('$')) call assert_equal(' 2 the~e', getline(1)) + undo + call feedkeys(":vglobal/the\<c-l>/d\<cr>", 'tx') + call assert_equal(1, line('$')) + call assert_equal(' 2 the~e', getline(1)) call Cmdline3_cleanup() endfunc @@ -518,7 +524,7 @@ func Test_search_cmdline7() " so that expansion of commandline works call test_override("char_avail", 1) new - let @/='b' + let @/ = 'b' call setline(1, [' bbvimb', '']) set incsearch " first match |