aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-11 22:40:57 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-11 22:50:54 +0100
commit04993f220a304efa029d44a74bbfa83a8530ea6e (patch)
treec5057fc1dbd6ff9add33a5392b2691ea2bcc5974 /src/nvim/ex_docmd.c
parent2929dbf2233f05f58e094ce4a80fb1320ac6d336 (diff)
downloadrneovim-04993f220a304efa029d44a74bbfa83a8530ea6e.tar.gz
rneovim-04993f220a304efa029d44a74bbfa83a8530ea6e.tar.bz2
rneovim-04993f220a304efa029d44a74bbfa83a8530ea6e.zip
vim-patch:8.0.1205: it is possible to unload a changed buffer
Problem: Using "1q" it is possible to unload a changed buffer. (Rick Howe) Solution: Check the right window for changes. https://github.com/vim/vim/commit/ff930cad8a9100eeb04256aab1a14de993c1d7e9
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index d79f66ef5f..10a8a1e4dc 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -5986,13 +5986,12 @@ static void ex_quit(exarg_T *eap)
return;
}
- /*
- * If there are more files or windows we won't exit.
- */
- if (check_more(FALSE, eap->forceit) == OK && only_one_window())
- exiting = TRUE;
- if ((!buf_hide(curbuf)
- && check_changed(curbuf, (p_awa ? CCGD_AW : 0)
+ // If there are more files or windows we won't exit.
+ if (check_more(FALSE, eap->forceit) == OK && only_one_window()) {
+ exiting = true;
+ }
+ if ((!buf_hide(wp->w_buffer)
+ && check_changed(wp->w_buffer, (p_awa ? CCGD_AW : 0)
| (eap->forceit ? CCGD_FORCEIT : 0)
| CCGD_EXCMD))
|| check_more(true, eap->forceit) == FAIL