mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
vim-patch:9.1.0543: Behavior of CursorMovedC is strange (#29608)
Problem: Behavior of CursorMovedC is strange.
Solution: Also trigger when the cmdline has changed.
(zeertzjq)
fixes: vim/vim#15069
closes: vim/vim#15071
8145620a95
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user