1
0
forked from aniani/vim

updated for version 7.3.545

Problem:    When closing a window or buffer autocommands may close it too,
            causing problems for where the autocommand was invoked from.
Solution:   Add the w_closing and b_closing flags.  When set disallow ":q" and
            ":close" to prevent recursive closing.
This commit is contained in:
Bram Moolenaar
2012-06-06 19:02:45 +02:00
parent 3b53dfb3b0
commit 362ce48048
5 changed files with 82 additions and 17 deletions

View File

@@ -6459,7 +6459,9 @@ ex_quit(eap)
}
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
if (curbuf_locked())
/* 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