From 77bb48e740b260acd884242d77dc3e306ff9795c Mon Sep 17 00:00:00 2001 From: Aufar Gilbran Date: Wed, 19 Aug 2020 00:49:51 +0800 Subject: vim-patch:8.1.0295: no 'incsearch' highlighting for :vimgrep and similar Problem: No 'incsearch' highlighting for :vimgrep and similar commands. Solution: Parse the :vimgrep command and similar ones to locate the search pattern. (Hirohito Higashi, closes vim/vim#3344) https://github.com/vim/vim/commit/264cf5cfaf40e704aea2578e70c15ed9a9d0161e --- test/functional/legacy/search_spec.lua | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'test/functional') diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index 0802b43689..bb039a585c 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -587,4 +587,56 @@ describe('search cmdline', function() ]]) feed('') end) + + it('incsearch works with :vimgrep family', function() + -- oldtest: Test_incsearch_vimgrep_dump(). + screen:try_resize(30, 4) + command('set incsearch hlsearch scrolloff=0') + funcs.setline(1, {'another one 2', 'that one 3', 'the one 1'}) + + feed(':vimgrep on') + screen:expect([[ + another {inc:on}e 2 | + that {hl:on}e 3 | + the {hl:on}e 1 | + :vimgrep on^ | + ]]) + feed('') + + feed(':vimg /on/ *.txt') + screen:expect([[ + another {inc:on}e 2 | + that {hl:on}e 3 | + the {hl:on}e 1 | + :vimg /on/ *.txt^ | + ]]) + feed('') + + feed(':vimgrepadd "\\on') + screen:expect([[ + another {inc:on}e 2 | + that {hl:on}e 3 | + the {hl:on}e 1 | + :vimgrepadd "\') + + feed(':lv "tha') + screen:expect([[ + another one 2 | + {inc:tha}t one 3 | + the one 1 | + :lv "tha^ | + ]]) + feed('') + + feed(':lvimgrepa "the" **/*.txt') + screen:expect([[ + ano{inc:the}r one 2 | + that one 3 | + {hl:the} one 1 | + :lvimgrepa "the" **/*.txt^ | + ]]) + feed('') + end) end) -- cgit