mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 18:36:30 +00:00
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)
1be4b81bfb
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user