Mercurial > vim
changeset 17750:b27d06bd0fde v8.1.1872
patch 8.1.1872: when Vim exits because of a signal, VimLeave is not triggered
commit https://github.com/vim/vim/commit/c7226684c82dde7eb6601e067ee2e9387e447903
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 17 16:33:23 2019 +0200
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 #4818)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 17 Aug 2019 16:45:03 +0200 |
parents | 314eb6b02037 |
children | ac9f5d3ac693 |
files | src/main.c src/version.c |
diffstat | 2 files changed, 16 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main.c +++ b/src/main.c @@ -541,12 +541,12 @@ vim_main2(void) #ifdef FEAT_GUI if (gui.starting) { -#if defined(UNIX) || defined(VMS) +# if defined(UNIX) || defined(VMS) /* When something caused a message from a vimrc script, need to output * an extra newline before the shell prompt. */ if (did_emsg || msg_didout) putchar('\n'); -#endif +# endif gui_start(NULL); /* will set full_screen to TRUE */ TIME_MSG("starting GUI"); @@ -1485,7 +1485,19 @@ getout(int exitval) #endif 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(); + } #ifdef FEAT_PROFILE profile_dump();