From 3985257496f48c98d6056c41be412807a65812d0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 15 Dec 2025 08:38:42 +0800 Subject: [PATCH] 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 --- src/nvim/ex_cmds.lua | 4 ++-- test/old/testdir/test_help.vim | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index 0f04dbd035..079c440438 100644 --- 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 index 36ae408da0..25f4491f80 100644 --- 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'))