mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06: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:
parent
dd9554a820
commit
0b8fc2742b
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user