From 3af43cffa028b88022e6bdc78a4e2f5470643219 Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Wed, 2 Apr 2025 14:14:11 +0200 Subject: fix(highlight): no match highlight during :substitute prompt #33262 Problem: Redrawing during a substitute confirm prompt causes the match highlight to disappear. Solution: Unset `highlight_match` after the prompt has returned. Use global highlight definitions in searchhl_spec.lua. --- src/nvim/ex_cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 34217107aa..275feb7589 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3788,7 +3788,6 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n redraw_later(curwin, UPD_SOME_VALID); show_cursor_info_later(true); update_screen(); - highlight_match = false; redraw_later(curwin, UPD_SOME_VALID); curwin->w_p_fen = save_p_fen; @@ -3797,6 +3796,7 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n snprintf(IObuff, IOSIZE, p, sub); p = xstrdup(IObuff); typed = prompt_for_input(p, HLF_R, true, NULL); + highlight_match = false; xfree(p); msg_didout = false; // don't scroll up -- cgit