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)
diff --git a/src/testdir/test31.in b/src/testdir/test31.in
index 7dc2334..3ba8431 100644
--- a/src/testdir/test31.in
+++ b/src/testdir/test31.in
@@ -69,6 +69,26 @@
 GA 4:all!
 :1wincmd w
 :w >>test.out
+:"
+:" test ":q!" and hidden buffer.
+:bw! Xtest1 Xtest2 Xtest3 Xtest4
+:sp Xtest1
+:wincmd w
+:bw!
+:set modified
+:bot sp Xtest2
+:set modified
+:bot sp Xtest3
+:set modified
+:wincmd t
+:hide
+:q!
+:w >>test.out
+:q!
+:w >>test.out
+:q!
+:call append(line('$'), "Oh, Not finished yet.")
+:w >>test.out
 :qa!
 ENDTEST
 
diff --git a/src/testdir/test31.ok b/src/testdir/test31.ok
index 185bdc7..3953197 100644
--- a/src/testdir/test31.ok
+++ b/src/testdir/test31.ok
@@ -10,3 +10,5 @@
 testtext 3 3 3
 testtext 1
 testtext 2 2 2
+testtext 3
+testtext 1