diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-01-26 21:34:32 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-01-26 21:50:37 -0500 |
commit | 5ede2766c8d994f9e299288d46cefdd12ffee47f (patch) | |
tree | 75d8bb3c9a3857ace177402a604aae63d434b51e /src/nvim/edit.c | |
parent | e673a0df1a0391b61a58cf3579754f7abd17e158 (diff) | |
download | rneovim-5ede2766c8d994f9e299288d46cefdd12ffee47f.tar.gz rneovim-5ede2766c8d994f9e299288d46cefdd12ffee47f.tar.bz2 rneovim-5ede2766c8d994f9e299288d46cefdd12ffee47f.zip |
vim-patch:8.2.0158: triggering CompleteDone earlier is not backwards compatible
Problem: Triggering CompleteDone earlier is not backwards compatible.
(Daniel Hahler)
Solution: Add CompleteDonePre instead.
https://github.com/vim/vim/commit/3f169ce17e8b779d105c96138a8b4246f2d270b9
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 9c22f09059..e253905057 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -3594,12 +3594,11 @@ static bool ins_compl_prep(int c) auto_format(FALSE, TRUE); - // 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. + // Trigger the CompleteDonePre event to give scripts a chance to + // act upon the completion 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_apply_autocmds(EVENT_COMPLETEDONEPRE); ins_compl_free(); compl_started = false; @@ -3625,6 +3624,9 @@ static bool ins_compl_prep(int c) */ if (want_cindent && in_cinkeys(KEY_COMPLETE, ' ', inindent(0))) do_c_expr_indent(); + // Trigger the CompleteDone event to give scripts a chance to act + // upon the end of completion. + ins_apply_autocmds(EVENT_COMPLETEDONE); } } else if (ctrl_x_mode == CTRL_X_LOCAL_MSG) /* Trigger the CompleteDone event to give scripts a chance to act |