Loading ...
Sorry, an error occurred while loading the content.

QuitPre event doesn't occur when :quitall or :wq commands are executed

Expand Messages
  • fujiistorage@...
    Hi. I have an issue about QuitPre event. [step] 1. Add following autocmd statements to .vimrc. - autocmd QuitPre * call system( touch ~/quitpre.txt ) 2. Open
    Message 1 of 2 , Mar 3, 2013
    • 0 Attachment
      Hi.
      I have an issue about QuitPre event.

      [step]
      1. Add following autocmd statements to .vimrc.
      - autocmd QuitPre * call system('touch ~/quitpre.txt')
      2. Open some file.
      3. exec :wq or :qall.

      [expected]
      After step3, ~/quitpre.txt exists. ('autocmd QuitPre' is executed)

      [actual]
      After step3, ~/quitpre.txt DOESNOT exist.

      [Version]
      version 7.3.843

      And I've created the patch. Could you check it?

      diff -r ad7bbe9ea65b -r f869a6b1de57 src/ex_docmd.c
      --- a/src/ex_docmd.c Tue Feb 26 22:54:11 2013 +0100
      +++ b/src/ex_docmd.c Sun Mar 03 16:30:08 2013 +0900
      @@ -6600,7 +6600,10 @@
      return;
      }
      #ifdef FEAT_AUTOCMD
      - if (curbuf_locked())
      + apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
      + /* Refuse to quick when locked or when the buffer in the last window is
      + * being closed (can only happen in autocommands). */
      + if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_closing))
      return;
      #endif

      @@ -6936,7 +6939,10 @@
      return;
      }
      #ifdef FEAT_AUTOCMD
      - if (curbuf_locked())
      + apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
      + /* Refuse to quick when locked or when the buffer in the last window is
      + * being closed (can only happen in autocommands). */
      + if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_closing))
      return;
      #endif



      Best.

      --
      Tatsuro Fujii
      fujiistorage@...

      --
      --
      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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Bram Moolenaar
      ... Thanks for the patch. I ll look into it. -- hundred-and-one symptoms of being an internet addict: 22. You ve already visited all the links at Yahoo and
      Message 2 of 2 , Mar 3, 2013
      • 0 Attachment
        Tatsuro Fujii wrote:

        > Hi.
        > I have an issue about QuitPre event.
        >
        > [step]
        > 1. Add following autocmd statements to .vimrc.
        > - autocmd QuitPre * call system('touch ~/quitpre.txt')
        > 2. Open some file.
        > 3. exec :wq or :qall.
        >
        > [expected]
        > After step3, ~/quitpre.txt exists. ('autocmd QuitPre' is executed)
        >
        > [actual]
        > After step3, ~/quitpre.txt DOESNOT exist.
        >
        > [Version]
        > version 7.3.843
        >
        > And I've created the patch. Could you check it?

        Thanks for the patch. I'll look into it.


        --
        hundred-and-one symptoms of being an internet addict:
        22. You've already visited all the links at Yahoo and you're halfway through
        Lycos.

        /// Bram Moolenaar -- Bram@... -- 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 vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.