aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-19 22:09:48 +0800
committerGitHub <noreply@github.com>2023-04-19 22:09:48 +0800
commit0d7bed34a29ef1add5d225a6809882fa6dce49d9 (patch)
treef12b217d2911f2e8bd19f6dc814750d274264a6b /src
parent7bf1a917b78ebc622b6691af9196b95b4a9d3142 (diff)
downloadrneovim-0d7bed34a29ef1add5d225a6809882fa6dce49d9.tar.gz
rneovim-0d7bed34a29ef1add5d225a6809882fa6dce49d9.tar.bz2
rneovim-0d7bed34a29ef1add5d225a6809882fa6dce49d9.zip
vim-patch:9.0.1470: deferred functions invoked in unexpected order (#23199)
Problem: Deferred functions invoked in unexpected order when using :qa and autocommands. Solution: Call deferred functions for the current funccal before using the stack. (closes vim/vim#12278) https://github.com/vim/vim/commit/1be4b81bfb3d7edf0e2ae41711d429e8fa5e0555
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval/userfunc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index 4cb2f9bd2b..51e109fdfb 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -3270,15 +3270,15 @@ static void handle_defer_one(funccall_T *funccal)
/// Called when exiting: call all defer functions.
void invoke_all_defer(void)
{
+ for (funccall_T *fc = current_funccal; fc != NULL; fc = fc->fc_caller) {
+ handle_defer_one(fc);
+ }
+
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);
- }
}
/// ":1,25call func(arg1, arg2)" function call.