summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-13 13:45:26 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-13 13:45:26 +0100
commita04f457a6c071179bac4088c9314007d39d5c5e0 (patch)
treecd40106e2bff68c4f02b18b83f2dffb616d2ccb5 /src/ex_cmds.c
parentb1842de5ca77205993e8ef76cf29803822e0e3ab (diff)
patch 9.0.0457: substitute prompt does not highlight an empty matchv9.0.0457
Problem: Substitute prompt does not highlight an empty match. Solution: Highlight at least one character.
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 311b9b7c2f..4938c6f485 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4308,6 +4308,10 @@ ex_substitute(exarg_T *eap)
- 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();