aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-19 08:24:29 +0800
committerGitHub <noreply@github.com>2024-06-19 08:24:29 +0800
commitb381b2d529741ddd4f3664959640917a10cd91b5 (patch)
tree4c606a997f28a74b531ab2888e2f59eac5329d70 /test
parenta2d510e1015d57f28ab20c5d2897527cae15b9c4 (diff)
parenta2a3e8412e6d4e9a952c57a5298016cae8bf5229 (diff)
downloadrneovim-b381b2d529741ddd4f3664959640917a10cd91b5.tar.gz
rneovim-b381b2d529741ddd4f3664959640917a10cd91b5.tar.bz2
rneovim-b381b2d529741ddd4f3664959640917a10cd91b5.zip
Merge pull request #29404 from zeertzjq/vim-8.2.4724
vim-patch:8.2.{4724,5047}: make CurSearch behavior match Vim
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/searchhl_spec.lua25
-rw-r--r--test/old/testdir/test_search.vim5
2 files changed, 29 insertions, 1 deletions
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index 493493da60..eab265cbb1 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -197,7 +197,8 @@ describe('search highlighting', function()
}
end)
- it('works for multiline match', function()
+ -- oldtest: Test_hlsearch_cursearch()
+ it('works for multiline match, no duplicate highlight', function()
command([[call setline(1, ['one', 'foo', 'bar', 'baz', 'foo the foo and foo', 'bar'])]])
feed('gg/foo<CR>')
screen:expect([[
@@ -281,6 +282,28 @@ describe('search highlighting', function()
{2:hij}kl |
/efg\nhij |
]])
+
+ -- check clearing CurSearch when using it for another match
+ feed('G?^abcd<CR>Y')
+ screen:expect([[
+ --- |
+ {1:abcd}efg |
+ hijkl |
+ --- |
+ {2:^abcd}efg |
+ hijkl |
+ ?^abcd |
+ ]])
+ feed('kkP')
+ screen:expect([[
+ --- |
+ {1:abcd}efg |
+ {2:^abcd}efg |
+ hijkl |
+ --- |
+ {1:abcd}efg |
+ ?^abcd |
+ ]])
end)
end)
diff --git a/test/old/testdir/test_search.vim b/test/old/testdir/test_search.vim
index 018ee7ad5a..8b535b5b19 100644
--- a/test/old/testdir/test_search.vim
+++ b/test/old/testdir/test_search.vim
@@ -1094,6 +1094,11 @@ func Test_hlsearch_cursearch()
call term_sendkeys(buf, "h\<C-L>")
call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_multiple_line_5', {})
+ " check clearing CurSearch when using it for another match
+ call term_sendkeys(buf, "G?^abcd\<CR>Y")
+ call term_sendkeys(buf, "kkP")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_changed_1', {})
+
call StopVimInTerminal(buf)
call delete('Xhlsearch_cursearch')
endfunc