From e8a8b9ed08405c830a049c4e43910c5ce9cdb669 Mon Sep 17 00:00:00 2001 From: Aufar Gilbran Date: Mon, 10 Aug 2020 03:02:54 +0800 Subject: vim-patch:8.1.0271: 'incsearch' doesn't work for :s, :g or :v Problem: 'incsearch' doesn't work for :s, :g or :v. Solution: Also use 'incsearch' for other commands that use a pattern. https://github.com/vim/vim/commit/b0acacd767a2b0618a7f3c08087708f4329580d0 --- src/nvim/testdir/test_search.vim | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 8036dea29f..087a261cca 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -367,6 +367,63 @@ func Test_search_cmdline3() bw! endfunc +func Cmdline3_prep() + throw 'skipped: Nvim does not support test_override()' + " 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() + throw 'skipped: Nvim does not support test_override()' + set noincsearch + call test_override("char_avail", 0) + bw! +endfunc + +func Test_search_cmdline3s() + throw 'skipped: Nvim does not support test_override()' + if !exists('+incsearch') + return + endif + call Cmdline3_prep() + 1 + call feedkeys(":%s/the\/xxx\", 'tx') + call assert_equal(' 2 xxxe', getline('.')) + + call Cmdline3_cleanup() +endfunc + +func Test_search_cmdline3g() + throw 'skipped: Nvim does not support test_override()' + if !exists('+incsearch') + return + endif + call Cmdline3_prep() + 1 + call feedkeys(":g/the\/d\", 'tx') + call assert_equal(' 3 the theother', getline(2)) + + call Cmdline3_cleanup() +endfunc + +func Test_search_cmdline3v() + throw 'skipped: Nvim does not support test_override()' + if !exists('+incsearch') + return + endif + call Cmdline3_prep() + 1 + call feedkeys(":v/the\/d\", 'tx') + call assert_equal(1, line('$')) + call assert_equal(' 2 the~e', getline(1)) + + call Cmdline3_cleanup() +endfunc + func Test_search_cmdline4() " See test/functional/legacy/search_spec.lua throw 'skipped: Nvim does not support test_override()' -- cgit