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 --- test/functional/ui/inccommand_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional') diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index afb0c9cfa6..74e85212c8 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -162,7 +162,7 @@ describe(":substitute, 'inccommand' preserves", function() insert(default_text) feed_command("set inccommand=" .. case) - local delims = { '/', '#', ';', '%', ',', '@', '!', ''} + local delims = { '/', '#', ';', '%', ',', '@', '!' } for _,delim in pairs(delims) do feed_command("%s"..delim.."lines"..delim.."LINES"..delim.."g") expect([[ -- cgit From ab7e101540435b7de221ded309b34f2f000105f4 Mon Sep 17 00:00:00 2001 From: Aufar Gilbran Date: Wed, 19 Aug 2020 00:49:38 +0800 Subject: vim-patch:8.1.0291: 'incsearch' highlighting not used for :sort Problem: 'incsearch' highlighting not used for :sort. Solution: Handle pattern in :sort command. https://github.com/vim/vim/commit/81f56536b1bc324eb173924a8cf4d7dbbf4f3fdb --- test/functional/legacy/search_spec.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/functional') diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index a207b176d3..0802b43689 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -21,6 +21,7 @@ describe('search cmdline', function() err = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, more = { bold = true, foreground = Screen.colors.SeaGreen4 }, tilde = { bold = true, foreground = Screen.colors.Blue1 }, + hl = { background = Screen.colors.Yellow }, }) end) @@ -570,4 +571,20 @@ describe('search cmdline', function() ?the | ]]) end) + + it('incsearch works with :sort', function() + -- oldtest: Test_incsearch_sort_dump(). + screen:try_resize(20, 4) + command('set incsearch hlsearch scrolloff=0') + funcs.setline(1, {'another one 2', 'that one 3', 'the one 1'}) + + feed(':sort ni u /on') + screen:expect([[ + another {inc:on}e 2 | + that {hl:on}e 3 | + the {hl:on}e 1 | + :sort ni u /on^ | + ]]) + feed('') + end) end) -- cgit 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