patch 8.1.0339: wrong highlight when 'incsearch' set and cancelling :s
Problem: Wrong highlight when 'incsearch' set and cancelling :s.
Solution: Reset search line range. (Hirohito Higashi, Masamichi Abe)
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index b998cc4..68dc3ec 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -956,6 +956,15 @@
call VerifyScreenDump(buf, 'Test_incsearch_substitute_09', {})
call term_sendkeys(buf, "\<Esc>")
+ call term_sendkeys(buf, ":set nocursorline\<CR>")
+
+ " All matches are highlighted for 'hlsearch' after the incsearch canceled
+ call term_sendkeys(buf, "1G*")
+ call term_sendkeys(buf, ":2,5s/foo")
+ sleep 100m
+ call term_sendkeys(buf, "\<Esc>")
+ call VerifyScreenDump(buf, 'Test_incsearch_substitute_10', {})
+
call StopVimInTerminal(buf)
call delete('Xis_subst_script')
endfunc