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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user