diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_getln.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 2e63a139c3..e3c7008d3b 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2188,6 +2188,7 @@ static int command_line_not_changed(CommandLineState *s) trigger_cmd_autocmd(get_cmdline_type(), EVENT_CURSORMOVEDC); s->prev_cmdpos = ccline.cmdpos; } + // Incremental searches for "/" and "?": // Enter command_line_not_changed() when a character has been read but the // command line did not change. Then we only search and redraw if something @@ -2662,10 +2663,15 @@ static void do_autocmd_cmdlinechanged(int firstc) static int command_line_changed(CommandLineState *s) { - s->prev_cmdpos = ccline.cmdpos; // Trigger CmdlineChanged autocommands. do_autocmd_cmdlinechanged(s->firstc > 0 ? s->firstc : '-'); + // Trigger CursorMovedC autocommands. + if (ccline.cmdpos != s->prev_cmdpos) { + trigger_cmd_autocmd(get_cmdline_type(), EVENT_CURSORMOVEDC); + s->prev_cmdpos = ccline.cmdpos; + } + const bool prev_cmdpreview = cmdpreview; if (s->firstc == ':' && current_sctx.sc_sid == 0 // only if interactive |