diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-19 07:59:35 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-19 08:09:46 +0800 |
commit | a0c982671ee2f4c4e87a6480d2ea4d23ba807273 (patch) | |
tree | 7067cacec0c072c6289a2f3a2b417775ef47e491 /src/nvim/eval/userfunc.c | |
parent | a11849abdf7eeb33423be2ee920c7b504379b39b (diff) | |
download | rneovim-a0c982671ee2f4c4e87a6480d2ea4d23ba807273.tar.gz rneovim-a0c982671ee2f4c4e87a6480d2ea4d23ba807273.tar.bz2 rneovim-a0c982671ee2f4c4e87a6480d2ea4d23ba807273.zip |
vim-patch:9.0.1469: deferred functions not called from autocommands
Problem: Deferred functions not called from autocommands.
Solution: Also go through the funccal_stack. (closes vim/vim#12267)
https://github.com/vim/vim/commit/960cf9119e3f4922ca9719feb5e0c0bc5e3b9840
Diffstat (limited to 'src/nvim/eval/userfunc.c')
-rw-r--r-- | src/nvim/eval/userfunc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index e8b50d8c94..4cb2f9bd2b 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -3270,8 +3270,14 @@ static void handle_defer_one(funccall_T *funccal) /// Called when exiting: call all defer functions. void invoke_all_defer(void) { - for (funccall_T *funccal = current_funccal; funccal != NULL; funccal = funccal->fc_caller) { - handle_defer_one(funccal); + for (funccal_entry_T *fce = funccal_stack; fce != NULL; fce = fce->next) { + for (funccall_T *fc = fce->top_funccal; fc != NULL; fc = fc->fc_caller) { + handle_defer_one(fc); + } + } + + for (funccall_T *fc = current_funccal; fc != NULL; fc = fc->fc_caller) { + handle_defer_one(fc); } } |