aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/search_spec.lua
diff options
context:
space:
mode:
authorAufar Gilbran <aufargilbran@gmail.com>2020-08-19 00:49:51 +0800
committerAufar Gilbran <aufargilbran@gmail.com>2020-09-11 10:33:20 +0800
commit77bb48e740b260acd884242d77dc3e306ff9795c (patch)
tree2245f611a02f272458d29142c8f92606784027b4 /test/functional/legacy/search_spec.lua
parentab7e101540435b7de221ded309b34f2f000105f4 (diff)
downloadrneovim-77bb48e740b260acd884242d77dc3e306ff9795c.tar.gz
rneovim-77bb48e740b260acd884242d77dc3e306ff9795c.tar.bz2
rneovim-77bb48e740b260acd884242d77dc3e306ff9795c.zip
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
Diffstat (limited to 'test/functional/legacy/search_spec.lua')
-rw-r--r--test/functional/legacy/search_spec.lua52
1 files changed, 52 insertions, 0 deletions
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('<esc>')
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('<esc>')
+
+ 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('<esc>')
+
+ feed(':vimgrepadd "\\<LT>on')
+ screen:expect([[
+ another {inc:on}e 2 |
+ that {hl:on}e 3 |
+ the {hl:on}e 1 |
+ :vimgrepadd "\<on^ |
+ ]])
+ feed('<esc>')
+
+ feed(':lv "tha')
+ screen:expect([[
+ another one 2 |
+ {inc:tha}t one 3 |
+ the one 1 |
+ :lv "tha^ |
+ ]])
+ feed('<esc>')
+
+ feed(':lvimgrepa "the" **/*.txt')
+ screen:expect([[
+ ano{inc:the}r one 2 |
+ that one 3 |
+ {hl:the} one 1 |
+ :lvimgrepa "the" **/*.txt^ |
+ ]])
+ feed('<esc>')
+ end)
end)