mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18:17 +00:00
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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user