To: vim_dev@googlegroups.com Subject: Patch 8.1.1872 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1872 Problem: When Vim exits because of a signal, VimLeave is not triggered. (Daniel Hahler) Solution: Unblock autocommands when triggering VimLeave. (closes #4818) Files: src/main.c *** ../vim-8.1.1871/src/main.c 2019-06-02 18:40:02.633508864 +0200 --- src/main.c 2019-08-17 16:30:05.357673939 +0200 *************** *** 541,552 **** #ifdef FEAT_GUI if (gui.starting) { ! #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 gui_start(NULL); /* will set full_screen to TRUE */ TIME_MSG("starting GUI"); --- 541,552 ---- #ifdef FEAT_GUI if (gui.starting) { ! # 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 gui_start(NULL); /* will set full_screen to TRUE */ TIME_MSG("starting GUI"); *************** *** 1485,1491 **** --- 1485,1503 ---- #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(); *** ../vim-8.1.1871/src/version.c 2019-08-17 16:15:49.737383014 +0200 --- src/version.c 2019-08-17 16:32:47.837018236 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 1872, /**/ -- hundred-and-one symptoms of being an internet addict: 83. Batteries in the TV remote now last for months. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///