patch 8.2.2542: highlight of char beyond line end is not correct
Problem: Highlight of char beyond line end is not correct. (Chuan Wei Foo)
Solution: Fix counting NUL as one cell. Draw one more character if the EOL
is part of the match. (closes #7883)
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index 2dc53d9..5fed81c 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -944,6 +944,26 @@
call delete('Xis_search_script')
endfunc
+func Test_hlsearch_dump()
+ CheckOption hlsearch
+ CheckScreendump
+
+ call writefile([
+ \ 'set hlsearch cursorline',
+ \ 'call setline(1, ["xxx", "xxx", "xxx"])',
+ \ '/.*',
+ \ '2',
+ \ ], 'Xhlsearch_script')
+ let buf = RunVimInTerminal('-S Xhlsearch_script', {'rows': 6, 'cols': 50})
+ call VerifyScreenDump(buf, 'Test_hlsearch_1', {})
+
+ call term_sendkeys(buf, "/\\_.*\<CR>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_2', {})
+
+ call StopVimInTerminal(buf)
+ call delete('Xhlsearch_script')
+endfunc
+
func Test_incsearch_substitute()
CheckOption incsearch