aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2024-03-20 14:59:04 +0100
committerGitHub <noreply@github.com>2024-03-20 21:59:04 +0800
commitc72d877c3374796a1e4b71481503225d59a9afc7 (patch)
treec4b42e87537ff7bf8b1b2e4e900319648e20404c /src/nvim/ex_getln.c
parent7549845e8d3fa809da659b72c3ee773d1c34118a (diff)
downloadrneovim-c72d877c3374796a1e4b71481503225d59a9afc7.tar.gz
rneovim-c72d877c3374796a1e4b71481503225d59a9afc7.tar.bz2
rneovim-c72d877c3374796a1e4b71481503225d59a9afc7.zip
fix(cmdline): wrong 'incsearch' highlighting after :redraw (#27947)
Problem: Calling :redraw from a timer callback clears 'incsearch' highlighting. Solution: Re-apply 'incsearch' highlighting if the screen was updated.
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index d482f9851e..e5d82cc126 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1167,6 +1167,7 @@ static int command_line_execute(VimState *state, int key)
return -1; // get another key
}
+ disptick_T display_tick_saved = display_tick;
CommandLineState *s = (CommandLineState *)state;
s->c = key;
@@ -1178,6 +1179,10 @@ static int command_line_execute(VimState *state, int key)
} else {
map_execute_lua(false);
}
+ // Re-apply 'incsearch' highlighting in case it was cleared.
+ if (display_tick > display_tick_saved && s->is_state.did_incsearch) {
+ may_do_incsearch_highlighting(s->firstc, s->count, &s->is_state);
+ }
// nvim_select_popupmenu_item() can be called from the handling of
// K_EVENT, K_COMMAND, or K_LUA.