summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-09-04 19:50:54 +0200
committerBram Moolenaar <Bram@vim.org>2016-09-04 19:50:54 +0200
commite0ab94e7123ca7855f45919114d948ef2bc1e8c3 (patch)
tree868d44c51ca94d1aade6e80cf07617acc1448f80 /src/ex_docmd.c
parentd77f9d595eb5f301b39b4373f2900a13c0ca30e2 (diff)
downloadvim-git-e0ab94e7123ca7855f45919114d948ef2bc1e8c3.tar.gz
patch 7.4.2324v7.4.2324
Problem: Crash when editing a new buffer and BufUnload autocommand wipes out the new buffer. (Norio Takagi) Solution: Don't allow wiping out this buffer. (partly by Hirohito Higashi) Move old style test13 into test_autocmd. Avoid ml_get error when editing a file.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index b568e46c3..dc0a71e68 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -7201,7 +7201,7 @@ ex_quit(exarg_T *eap)
/* Refuse to quit when locked or when the buffer in the last window is
* being closed (can only happen in autocommands). */
if (curbuf_locked() || (wp->w_buffer->b_nwindows == 1
- && wp->w_buffer->b_closing))
+ && wp->w_buffer->b_locked > 0))
return;
#endif
@@ -7283,7 +7283,7 @@ ex_quit_all(exarg_T *eap)
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
/* Refuse to quit 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))
+ if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_locked > 0))
return;
#endif
@@ -7665,7 +7665,7 @@ ex_exit(exarg_T *eap)
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
/* Refuse to quit 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))
+ if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_locked > 0))
return;
#endif