- regmatch.startpos[0].lnum;
search_match_endcol = regmatch.endpos[0].col
+ len_change;
+ if (search_match_lines == 0
+ && search_match_endcol == 0)
+ // highlight at least one character for /^/
+ search_match_endcol = 1;
highlight_match = TRUE;
update_topline();
source shared.vim
source check.vim
+source screendump.vim
func Test_multiline_subst()
enew!
bw!
endfunc
+func Test_sub_highlight_zero_match()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ call setline(1, ['one', 'two', 'three'])
+ END
+ call writefile(lines, 'XscriptSubHighlight', 'D')
+ let buf = RunVimInTerminal('-S XscriptSubHighlight', #{rows: 8, cols: 60})
+ call term_sendkeys(buf, ":%s/^/ /c\<CR>")
+ call VerifyScreenDump(buf, 'Test_sub_highlight_zer_match_1', {})
+
+ call term_sendkeys(buf, "\<Esc>")
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_nocatch_sub_failure_handling()
" normal error results in all replacements
func Foo()