diff src/testdir/test_search.vim @ 24514:e3efa11b6a1e v8.2.2797

patch 8.2.2797: Search highlight disappears in the Visual area Commit: https://github.com/vim/vim/commit/2d5f385cee3668c44089edcb9d60b0b5d751ee5d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 21 15:11:42 2021 +0200 patch 8.2.2797: Search highlight disappears in the Visual area Problem: Search highlight disappears in the Visual area. Solution: Combine the search attributes. (closes https://github.com/vim/vim/issues/8134)
author Bram Moolenaar <Bram@vim.org>
date Wed, 21 Apr 2021 15:15:04 +0200
parents bb2e921d2601
children 97789fcef0cf
line wrap: on
line diff
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -964,6 +964,26 @@ func Test_hlsearch_dump()
   call delete('Xhlsearch_script')
 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, "\<Esc>")
+
+  call StopVimInTerminal(buf)
+  call delete('Xhlvisual_script')
+endfunc
+
 func Test_incsearch_substitute()
   CheckOption incsearch