vim-patch:8.1.1872: when Vim exits because of a signal, VimLeave is not triggered

Problem:    When Vim exits because of a signal, VimLeave is not triggered.
            (Daniel Hahler)
Solution:   Unblock autocommands when triggering VimLeave. (closes vim/vim#4818)
c7226684c8
This commit is contained in:
Jan Edmund Lazo
2020-12-20 20:26:27 -05:00
parent a1ec36ff31
commit d1142e02bf
2 changed files with 12 additions and 1 deletions

View File

@@ -662,7 +662,17 @@ void getout(int exitval)
}
if (v_dying <= 1) {
int unblock = 0;
// deathtrap() blocks autocommands, but we do want to trigger VimLeave.
if (is_autocmd_blocked()) {
unblock_autocmds();
unblock++;
}
apply_autocmds(EVENT_VIMLEAVE, NULL, NULL, false, curbuf);
if (unblock) {
block_autocmds();
}
}
profile_dump();