vim-patch:8.2.0769: VimLeavePre not triggered when Vim is terminated

Problem:    VimLeavePre not triggered when Vim is terminated.
Solution:   Unblock autocommands.
129d6bf6b3
This commit is contained in:
Jan Edmund Lazo
2020-12-22 00:15:18 -05:00
parent 40f9b1dd2c
commit caf2620f18
2 changed files with 24 additions and 2 deletions

View File

@@ -653,7 +653,18 @@ void getout(int exitval)
}
}
}
apply_autocmds(EVENT_VIMLEAVEPRE, NULL, NULL, FALSE, curbuf);
int unblock = 0;
// deathtrap() blocks autocommands, but we do want to trigger
// VimLeavePre.
if (is_autocmd_blocked()) {
unblock_autocmds();
unblock++;
}
apply_autocmds(EVENT_VIMLEAVEPRE, NULL, NULL, false, curbuf);
if (unblock) {
block_autocmds();
}
}
if (p_shada && *p_shada != NUL) {