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 | ||||
-rw-r--r-- | test/functional/api/server_requests_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/039_visual_block_mode_commands_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/eval_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/glob2regpat_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/quickfix_spec.lua | 3 | ||||
-rw-r--r-- | test/unit/strings_spec.lua | 1 |
10 files changed, 20 insertions, 10 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 dc1201fa8e..f865e13f55 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, diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua index 16a4423535..c0099e44c4 100644 --- a/test/functional/api/server_requests_spec.lua +++ b/test/functional/api/server_requests_spec.lua @@ -43,7 +43,7 @@ describe('server -> client', function() stop() end - local function on_request(method, args) + local function on_request() -- No need to evaluate the args, we are only interested in -- a response that contains an array with an empty string. return {1, 2, '', 3, 'asdf'} diff --git a/test/functional/legacy/039_visual_block_mode_commands_spec.lua b/test/functional/legacy/039_visual_block_mode_commands_spec.lua index 55db9169fa..6e1879035b 100644 --- a/test/functional/legacy/039_visual_block_mode_commands_spec.lua +++ b/test/functional/legacy/039_visual_block_mode_commands_spec.lua @@ -5,7 +5,7 @@ local helpers = require('test.functional.helpers') local nvim, eq = helpers.meths, helpers.eq local insert, feed = helpers.insert, helpers.feed local clear, expect = helpers.clear, helpers.expect -local source, execute = helpers.source, helpers.execute +local execute = helpers.execute describe('Visual block mode', function() diff --git a/test/functional/legacy/eval_spec.lua b/test/functional/legacy/eval_spec.lua index 05cd73dbd4..1c81b47ed6 100644 --- a/test/functional/legacy/eval_spec.lua +++ b/test/functional/legacy/eval_spec.lua @@ -3,7 +3,7 @@ local helpers = require('test.functional.helpers') local feed, insert, source = helpers.feed, helpers.insert, helpers.source local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect -local eq, eval, wait, write_file = helpers.eq, helpers.eval, helpers.wait, helpers.write_file +local eq, eval, write_file = helpers.eq, helpers.eval, helpers.write_file local function has_clipboard() clear() diff --git a/test/functional/legacy/glob2regpat_spec.lua b/test/functional/legacy/glob2regpat_spec.lua index 357128bcb6..0492143616 100644 --- a/test/functional/legacy/glob2regpat_spec.lua +++ b/test/functional/legacy/glob2regpat_spec.lua @@ -1,7 +1,7 @@ -- Tests for signs local helpers = require('test.functional.helpers') -local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect +local clear, execute = helpers.clear, helpers.execute local eq, neq, eval = helpers.eq, helpers.neq, helpers.eval describe('glob2regpat()', function() diff --git a/test/functional/legacy/quickfix_spec.lua b/test/functional/legacy/quickfix_spec.lua index 7a9958b949..88f86815b3 100644 --- a/test/functional/legacy/quickfix_spec.lua +++ b/test/functional/legacy/quickfix_spec.lua @@ -1,8 +1,7 @@ -- Test for the quickfix commands. local helpers = require('test.functional.helpers') -local insert, source = helpers.insert, helpers.source -local clear, expect = helpers.clear, helpers.expect +local source, clear = helpers.source, helpers.clear describe('helpgrep', function() before_each(clear) diff --git a/test/unit/strings_spec.lua b/test/unit/strings_spec.lua index b310ccb541..e935d2af6a 100644 --- a/test/unit/strings_spec.lua +++ b/test/unit/strings_spec.lua @@ -1,7 +1,6 @@ local helpers = require("test.unit.helpers") local cimport = helpers.cimport -local internalize = helpers.internalize local eq = helpers.eq local ffi = helpers.ffi local to_cstr = helpers.to_cstr |