diff src/ex_docmd.c @ 12654:d03798bddf5e v8.0.1205

patch 8.0.1205: it is possible to unload a changed buffer commit https://github.com/vim/vim/commit/ff930cad8a9100eeb04256aab1a14de993c1d7e9 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 19 17:12:10 2017 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Thu, 19 Oct 2017 17:15:04 +0200
parents 272ecbaf1b4f
children e769c912fcd9
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -7245,8 +7245,8 @@ ex_quit(exarg_T *eap)
      */
     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 ((!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