patch 8.2.3940: match highlight disappears when doing incsearch for ":s/pat"
Problem: Match highlight disappears when doing incsearch for ":s/pat".
Solution: Only use line limit for incsearch highlighting. (closes #9425)
diff --git a/src/testdir/dumps/Test_match_with_incsearch_1.dump b/src/testdir/dumps/Test_match_with_incsearch_1.dump
new file mode 100644
index 0000000..8a9d30c
--- /dev/null
+++ b/src/testdir/dumps/Test_match_with_incsearch_1.dump
@@ -0,0 +1,6 @@
+>0+0&#ffffff0| @73
+|1| @73
+|2+0#ffffff16#e000002| +0#0000000#ffffff0@73
+|3| @73
+|4| @73
+@57|1|,|1| @10|T|o|p|
diff --git a/src/testdir/dumps/Test_match_with_incsearch_2.dump b/src/testdir/dumps/Test_match_with_incsearch_2.dump
new file mode 100644
index 0000000..9e9868b
--- /dev/null
+++ b/src/testdir/dumps/Test_match_with_incsearch_2.dump
@@ -0,0 +1,6 @@
+|0+1&#ffffff0| +0&&@73
+|1| @73
+|2+0#ffffff16#e000002| +0#0000000#ffffff0@73
+|3| @73
+|4| @73
+|:|s|/|0> @70
diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim
index 6ca163b..0af45a4 100644
--- a/src/testdir/test_match.vim
+++ b/src/testdir/test_match.vim
@@ -366,6 +366,27 @@
call delete('XscriptMatchLinebreak')
endfunc
+func Test_match_with_incsearch()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ set incsearch
+ call setline(1, range(20))
+ call matchaddpos('ErrorMsg', [3])
+ END
+ call writefile(lines, 'XmatchWithIncsearch')
+ let buf = RunVimInTerminal('-S XmatchWithIncsearch', #{rows: 6})
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_match_with_incsearch_1', {})
+
+ call term_sendkeys(buf, ":s/0")
+ call VerifyScreenDump(buf, 'Test_match_with_incsearch_2', {})
+
+ call term_sendkeys(buf, "\<CR>")
+ call StopVimInTerminal(buf)
+ call delete('XmatchWithIncsearch')
+endfunc
+
" Test for deleting matches outside of the screen redraw top/bottom lines
" This should cause a redraw of those lines.
func Test_matchdelete_redraw()