0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.0769: VimLeavePre not triggered when Vim is terminated

Problem:    VimLeavePre not triggered when Vim is terminated.
Solution:   Unblock autocommands.
This commit is contained in:
Bram Moolenaar
2020-05-16 16:08:35 +02:00
parent e75ba268b3
commit 129d6bf6b3
3 changed files with 25 additions and 1 deletions

View File

@@ -1576,6 +1576,7 @@ getout(int exitval)
tabpage_T *next_tp;
buf_T *buf;
win_T *wp;
int unblock = 0;
// Trigger BufWinLeave for all windows, but only once per buffer.
for (tp = first_tabpage; tp != NULL; tp = next_tp)
@@ -1617,7 +1618,17 @@ getout(int exitval)
// autocmd deleted the buffer
break;
}
// 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();
}
#ifdef FEAT_VIMINFO