summaryrefslogtreecommitdiff
path: root/src/userfunc.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-19 14:21:24 +0100
committerBram Moolenaar <Bram@vim.org>2023-04-19 14:21:24 +0100
commit1be4b81bfb3d7edf0e2ae41711d429e8fa5e0555 (patch)
tree716eb27d91cb33a19ce16127f73cec3fdffd1e89 /src/userfunc.c
parent960cf9119e3f4922ca9719feb5e0c0bc5e3b9840 (diff)
downloadvim-git-1be4b81bfb3d7edf0e2ae41711d429e8fa5e0555.tar.gz
patch 9.0.1470: deferred functions invoked in unexpected orderv9.0.1470
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 #12278)
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index 0680767d3..fbde6edd0 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -6144,12 +6144,12 @@ invoke_funccall_defer(funccall_T *fc)
void
invoke_all_defer(void)
{
+ for (funccall_T *fc = current_funccal; fc != NULL; fc = fc->fc_caller)
+ invoke_funccall_defer(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)
invoke_funccall_defer(fc);
-
- for (funccall_T *fc = current_funccal; fc != NULL; fc = fc->fc_caller)
- invoke_funccall_defer(fc);
}
/*