Patch 8.1.1872

6 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 17, 2019, 10:35:25 AM8/17/19
to vim...@googlegroups.com

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 -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages