aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-03-20 14:01:22 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-03-22 18:42:16 +0100
commit165ba3e636769c38d67285e1b8ea2966ccb00b30 (patch)
tree06dddf294d07fbb93aea6711dea72e014eba08b7 /src/nvim/ex_docmd.c
parentca853edb6f9ffe1d2e5d4a63bf88e4c3a059f5fb (diff)
downloadrneovim-165ba3e636769c38d67285e1b8ea2966ccb00b30.tar.gz
rneovim-165ba3e636769c38d67285e1b8ea2966ccb00b30.tar.bz2
rneovim-165ba3e636769c38d67285e1b8ea2966ccb00b30.zip
vim-patch:7.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. https://github.com/vim/vim/commit/e0ab94e7123ca7855f45919114d948ef2bc1e8c3
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index bd3b8c204a..ebfbf2bf09 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -5775,7 +5775,7 @@ static void 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_nwindows == 1 && wp->w_buffer->b_locked > 0)) {
return;
}
@@ -5836,7 +5836,7 @@ static void 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;
exiting = true;
@@ -6131,7 +6131,7 @@ static void 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;
// if more files or windows we won't exit