From c196119acbd5de0e9e5fae91db62fc9dfc675f8d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 13 May 2022 21:20:15 +0800 Subject: vim-patch:8.2.2797: Search highlight disappears in the Visual area (#17947) Problem: Search highlight disappears in the Visual area. Solution: Combine the search attributes. (closes vim/vim#8134) https://github.com/vim/vim/commit/2d5f385cee3668c44089edcb9d60b0b5d751ee5d --- src/nvim/testdir/test_search.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index d359e69f91..454c956996 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -925,6 +925,26 @@ func Test_hlsearch_block_visual_match() call delete('Xhlsearch_block') endfunc +func Test_hlsearch_and_visual() + CheckOption hlsearch + CheckScreendump + + call writefile([ + \ 'set hlsearch', + \ 'call setline(1, repeat(["xxx yyy zzz"], 3))', + \ 'hi Search cterm=bold', + \ '/yyy', + \ 'call cursor(1, 6)', + \ ], 'Xhlvisual_script') + let buf = RunVimInTerminal('-S Xhlvisual_script', {'rows': 6, 'cols': 40}) + call term_sendkeys(buf, "vjj") + call VerifyScreenDump(buf, 'Test_hlsearch_visual_1', {}) + call term_sendkeys(buf, "\") + + call StopVimInTerminal(buf) + call delete('Xhlvisual_script') +endfunc + func Test_incsearch_substitute() CheckFunction test_override CheckOption incsearch -- cgit