patch 8.2.0295: highlighting for :s wrong when using different separator
Problem: Highlighting for :s wrong when using different separator.
Solution: Use separat argument for search direction and separator. (Rob
Pilling, closes #5665)
diff --git a/src/testdir/dumps/Test_incsearch_substitute_15.dump b/src/testdir/dumps/Test_incsearch_substitute_15.dump
new file mode 100644
index 0000000..41dd358
--- /dev/null
+++ b/src/testdir/dumps/Test_incsearch_substitute_15.dump
@@ -0,0 +1,4 @@
+|h+0&#ffffff0|e+1&&|l@1|o|/|t|h|e|r+0&&|e| @8
+|~+0#4040ff13&| @18
+|~| @18
+|:+0#0000000&|%|s|;|e|l@1|o|/|t|h|e> @7
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index afbea94..6ba87fc 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -1084,6 +1084,30 @@
call delete('Xis_subst_script')
endfunc
+func Test_incsearch_highlighting()
+ if !exists('+incsearch')
+ return
+ endif
+ if !CanRunVimInTerminal()
+ throw 'Skipped: cannot make screendumps'
+ endif
+
+ call writefile([
+ \ 'set incsearch hlsearch',
+ \ 'call setline(1, "hello/there")',
+ \ ], 'Xis_subst_hl_script')
+ let buf = RunVimInTerminal('-S Xis_subst_hl_script', {'rows': 4, 'cols': 20})
+ " Give Vim a chance to redraw to get rid of the spaces in line 2 caused by
+ " the 'ambiwidth' check.
+ sleep 300m
+
+ " Using a different search delimiter should still highlight matches
+ " that contain a '/'.
+ call term_sendkeys(buf, ":%s;ello/the")
+ call VerifyScreenDump(buf, 'Test_incsearch_substitute_15', {})
+ call term_sendkeys(buf, "<Esc>")
+endfunc
+
func Test_incsearch_with_change()
if !has('timers') || !exists('+incsearch') || !CanRunVimInTerminal()
throw 'Skipped: cannot make screendumps and/or timers feature and/or incsearch option missing'