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:
Justin M. Keyes 2019-03-25 03:55:12 +01:00
parent dd9554a820
commit 0b8fc2742b

View File

@ -6392,6 +6392,7 @@ void ex_substitute(exarg_T *eap)
}
block_autocmds(); // Disable events during command preview.
input_disable_events();
char_u *save_eap = eap->arg;
garray_T save_view;
@ -6434,6 +6435,7 @@ void ex_substitute(exarg_T *eap)
restore_search_patterns();
win_size_restore(&save_view);
ga_clear(&save_view);
input_enable_events();
unblock_autocmds();
}