mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
inccommand: Disable K_EVENT during preview calculation
'inccommand' invokes ex_substitute() to build its "preview". During the brief (~millisecond) time it takes to execute that function, the buffer is "dirty" (its contents are invalid). Events must not be handled during this time, else they would see a temporary state which is not the true, logical state of the buffer. ref #9777
This commit is contained in:
@@ -6392,6 +6392,7 @@ void ex_substitute(exarg_T *eap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
block_autocmds(); // Disable events during command preview.
|
block_autocmds(); // Disable events during command preview.
|
||||||
|
input_disable_events();
|
||||||
|
|
||||||
char_u *save_eap = eap->arg;
|
char_u *save_eap = eap->arg;
|
||||||
garray_T save_view;
|
garray_T save_view;
|
||||||
@@ -6434,6 +6435,7 @@ void ex_substitute(exarg_T *eap)
|
|||||||
restore_search_patterns();
|
restore_search_patterns();
|
||||||
win_size_restore(&save_view);
|
win_size_restore(&save_view);
|
||||||
ga_clear(&save_view);
|
ga_clear(&save_view);
|
||||||
|
input_enable_events();
|
||||||
unblock_autocmds();
|
unblock_autocmds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user