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.

ff930cad8a
This commit is contained in:
Justin M. Keyes
2018-02-11 22:40:57 +01:00
parent 2929dbf223
commit 04993f220a
2 changed files with 19 additions and 7 deletions

View File

@@ -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