diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-01-26 22:43:31 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-01-26 22:43:31 +0100 |
commit | 3f169ce17e8b779d105c96138a8b4246f2d270b9 (patch) | |
tree | 2723f598d986390199afb8c86298ea5c6391ebb9 /src/insexpand.c | |
parent | 318e7a9c03ed4beadd3c6089f5807938e3c1f843 (diff) |
patch 8.2.0158: triggering CompleteDone earlier is not backwards compatiblev8.2.0158
Problem: Triggering CompleteDone earlier is not backwards compatible.
(Daniel Hahler)
Solution: Add CompleteDonePre instead.
Diffstat (limited to 'src/insexpand.c')
-rw-r--r-- | src/insexpand.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/insexpand.c b/src/insexpand.c index e3c811a50b..0be20092ac 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -2061,12 +2061,11 @@ 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; @@ -2092,6 +2091,9 @@ ins_compl_prep(int c) if (want_cindent && in_cinkeys(KEY_COMPLETE, ' ', inindent(0))) do_c_expr_indent(); #endif + // 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) |