diff options
-rw-r--r-- | src/nvim/ex_docmd.c | 9 | ||||
-rw-r--r-- | src/nvim/testdir/test13.in | 6 | ||||
-rw-r--r-- | src/nvim/testdir/test13.ok | 1 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
4 files changed, 15 insertions, 3 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 1ae440c757..cb8f91328d 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -5656,8 +5656,13 @@ static void ex_quit(exarg_T *eap) || (only_one_window() && check_changed_any(eap->forceit))) { not_exiting(); } else { - 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)) { getout(0); } /* close window; may free buffer */ diff --git a/src/nvim/testdir/test13.in b/src/nvim/testdir/test13.in index cb8a6fff89..6713f80e88 100644 --- a/src/nvim/testdir/test13.in +++ b/src/nvim/testdir/test13.in @@ -48,6 +48,12 @@ otestje3 :au BufWipeout Xtestje1 buf Xtestje1 :bwipe :w >>test.out +:only +:new|set buftype=help +:wincmd w +:1quit +:$put ='Final line' +:$w >>test.out :qa! ENDTEST diff --git a/src/nvim/testdir/test13.ok b/src/nvim/testdir/test13.ok index 0f1fc347a4..66ebce63f7 100644 --- a/src/nvim/testdir/test13.ok +++ b/src/nvim/testdir/test13.ok @@ -28,3 +28,4 @@ testje1 contents contents end of testfile +Final line diff --git a/src/nvim/version.c b/src/nvim/version.c index 33211cdf14..aff1be3919 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -548,7 +548,7 @@ static int included_patches[] = { // 743, // 742, 741, - // 740, + 740, 739, // 738 NA // 737, |