]> granicus.if.org Git - vim/commitdiff
patch 7.4.740 v7.4.740
authorBram Moolenaar <Bram@vim.org>
Fri, 19 Jun 2015 10:43:07 +0000 (12:43 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 19 Jun 2015 10:43:07 +0000 (12:43 +0200)
Problem:    ":1quit" works like ":.quit". (Bohr Shaw)
Solution:   Don't exit Vim when a range is specified. (Christian Brabandt)

src/ex_docmd.c
src/testdir/test13.in
src/testdir/test13.ok
src/version.c

index 9ae8fff2a6a71ed236487b2032aaebcf7db81b98..971a2022bde1e68c05091af4a5e611a4670ad358 100644 (file)
@@ -7092,7 +7092,14 @@ ex_quit(eap)
     else
     {
 #ifdef FEAT_WINDOWS
-       if (only_one_window())      /* quit last window */
+       /* quit last window
+        * Note: only_one_window() returns true, even so a help window is
+        * still open. In that case only quit, if no address has been
+        * specified. Example:
+        * :h|wincmd w|1q     - don't quit
+        * :h|wincmd w|q      - quit
+        */
+       if (only_one_window() && (firstwin == lastwin || eap->addr_count == 0))
 #endif
            getout(0);
 #ifdef FEAT_WINDOWS
index cb8a6fff89167b65432e1ddd093f2024b546b241..cbf78c73678403d29e19e80a61cde2f4be5e7bf2 100644 (file)
@@ -48,6 +48,12 @@ otestje3\e
 :au BufWipeout Xtestje1 buf Xtestje1
 :bwipe
 :w >>test.out
+:only
+:help
+:wincmd w
+:1quit
+:$put ='Final line'
+:$w >>test.out
 :qa!
 ENDTEST
 
index 0f1fc347a457c4478ad41e3c776ed0d136cb7f3a..66ebce63f7c669a41c242b90d83cfcbe10c394c0 100644 (file)
@@ -28,3 +28,4 @@ testje1
        contents
        contents
 end of testfile
+Final line
index 03352a7aad5d92ded6303460fc7c641bb60a1dd2..df9b506a08a727df8ac7ba37c851c6c433334b07 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    740,
 /**/
     739,
 /**/