diff options
-rw-r--r-- | src/nvim/edit.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 68fa99484c..9c22f09059 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -3594,17 +3594,12 @@ static bool ins_compl_prep(int c) auto_format(FALSE, TRUE); - { - const int new_mode = ctrl_x_mode; - - // Trigger the CompleteDone event to give scripts a chance to - // act upon the completion. Do this before clearing the info, - // and restore ctrl_x_mode, so that complete_info() can be - // used. - ctrl_x_mode = prev_mode; - ins_apply_autocmds(EVENT_COMPLETEDONE); - ctrl_x_mode = new_mode; - } + // Trigger the CompleteDone event to give scripts a chance to + // act upon the completion. Do this before clearing the info, + // and restore ctrl_x_mode, so that complete_info() can be + // used. + ctrl_x_mode = prev_mode; + ins_apply_autocmds(EVENT_COMPLETEDONE); ins_compl_free(); compl_started = false; |