commit 3985257496f48c98d6056c41be412807a65812d0
parent 63737e6e73d4a5c3fdd73b54e6e829c17a2c62b3
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon, 15 Dec 2025 08:38:42 +0800
vim-patch:9.1.1979: :helpclose allows range and counts (#36966)
Problem: :helpclose incorrectly accepts a range and a count.
Solution: Remove EX_COUNT and EX_RANGE from the command definition.
(Doug Kearns)
closes: vim/vim#18917
https://github.com/vim/vim/commit/4c141bae3bd7afd7eb63c72c835d356fbdff61e2
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Diffstat:
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua
@@ -1106,8 +1106,8 @@ M.cmds = {
},
{
command = 'helpclose',
- flags = bit.bor(RANGE, COUNT, TRLBAR),
- addr_type = 'ADDR_OTHER',
+ flags = TRLBAR,
+ addr_type = 'ADDR_NONE',
func = 'ex_helpclose',
},
{
diff --git a/test/old/testdir/test_help.vim b/test/old/testdir/test_help.vim
@@ -74,6 +74,13 @@ func Test_help_errors()
bwipe!
endfunc
+func Test_helpclose_errors()
+ call assert_fails('42helpclose', 'E481:')
+ call assert_fails('helpclose 42', 'E488:')
+ call assert_fails('helpclose foo', 'E488:')
+ call assert_fails('helpclose!', 'E477:')
+endfunc
+
func Test_help_expr()
help expr-!~?
call assert_equal('vimeval.txt', expand('%:t'))