diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-03-25 03:55:12 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-04-14 02:22:19 +0200 |
commit | 0b8fc2742b9b559c4607202f5e6a79166a2b60d0 (patch) | |
tree | 297dc3a02495e787b7e8c95190aea0be4ef381cb | |
parent | dd9554a8205c18ab4194d21445bb1fe6c960229f (diff) | |
download | rneovim-0b8fc2742b9b559c4607202f5e6a79166a2b60d0.tar.gz rneovim-0b8fc2742b9b559c4607202f5e6a79166a2b60d0.tar.bz2 rneovim-0b8fc2742b9b559c4607202f5e6a79166a2b60d0.zip |
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
-rw-r--r-- | src/nvim/ex_cmds.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index af92a9c846..150e13efd5 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -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(); } |