summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-06-19 12:43:07 +0200
committerBram Moolenaar <Bram@vim.org>2015-06-19 12:43:07 +0200
commitc7a0d32c834ff321491d8fd7bc68bf6cabd11e44 (patch)
treeb6b44a0b1ba641a2b63f1185c454c342f387cdf0 /src
parentacc39888cddbc8082fb3b89c1a46646bdca55e42 (diff)
downloadvim-c7a0d32c834ff321491d8fd7bc68bf6cabd11e44.zip
patch 7.4.740
Problem: ":1quit" works like ":.quit". (Bohr Shaw) Solution: Don't exit Vim when a range is specified. (Christian Brabandt)
Diffstat (limited to 'src')
-rw-r--r--src/ex_docmd.c9
-rw-r--r--src/testdir/test13.in6
-rw-r--r--src/testdir/test13.ok1
-rw-r--r--src/version.c2
4 files changed, 17 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 9ae8fff2a..971a2022b 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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
diff --git a/src/testdir/test13.in b/src/testdir/test13.in
index cb8a6fff8..cbf78c736 100644
--- a/src/testdir/test13.in
+++ b/src/testdir/test13.in
@@ -48,6 +48,12 @@ otestje3
:au BufWipeout Xtestje1 buf Xtestje1
:bwipe
:w >>test.out
+:only
+:help
+:wincmd w
+:1quit
+:$put ='Final line'
+:$w >>test.out
:qa!
ENDTEST
diff --git a/src/testdir/test13.ok b/src/testdir/test13.ok
index 0f1fc347a..66ebce63f 100644
--- a/src/testdir/test13.ok
+++ b/src/testdir/test13.ok
@@ -28,3 +28,4 @@ testje1
contents
contents
end of testfile
+Final line
diff --git a/src/version.c b/src/version.c
index 03352a7aa..df9b506a0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 740,
+/**/
739,
/**/
738,