From 8c399d6b37f967d0ec9991d873666036de196a0a Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 10 May 2016 22:50:31 -0400 Subject: vim-patch:7.4.1037 Problem: Using "q!" when there is a modified hidden buffer does not unload the current buffer, resulting in the need to abandon it again. Solution: When using "q!" unload the current buffer when needed. (Yasuhiro Matsumoto, Hirohito Higashi) https://github.com/vim/vim/commit/027387f70c671f62e3e08e0bdd09ec05b0232735 --- src/nvim/ex_docmd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 89c35a3c45..bbe3525403 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -5674,7 +5674,7 @@ static void ex_quit(exarg_T *eap) | (eap->forceit ? CCGD_FORCEIT : 0) | CCGD_EXCMD)) || check_more(TRUE, eap->forceit) == FAIL - || (only_one_window() && check_changed_any(eap->forceit))) { + || (only_one_window() && check_changed_any(eap->forceit, true))) { not_exiting(); } else { // quit last window @@ -5723,9 +5723,10 @@ static void ex_quit_all(exarg_T *eap) if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_closing)) return; - exiting = TRUE; - if (eap->forceit || !check_changed_any(FALSE)) + exiting = true; + if (eap->forceit || !check_changed_any(false, false)) { getout(0); + } not_exiting(); } @@ -6019,7 +6020,7 @@ static void ex_exit(exarg_T *eap) || curbufIsChanged()) && do_write(eap) == FAIL) || check_more(TRUE, eap->forceit) == FAIL - || (only_one_window() && check_changed_any(eap->forceit))) { + || (only_one_window() && check_changed_any(eap->forceit, false))) { not_exiting(); } else { if (only_one_window()) /* quit last window, exit Vim */ -- cgit