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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201908171435.x7HEZIIw000497%40masaka.moolenaar.net.

Raspunde prin e-mail lui