mirror of
https://github.com/neovim/neovim.git
synced 2026-08-25 16:41:52 +00:00
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)
960cf9119e
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user