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

4c141bae3b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:
zeertzjq
2025-12-15 08:38:42 +08:00
committed by GitHub
parent 63737e6e73
commit 3985257496
2 changed files with 9 additions and 2 deletions

View File

@@ -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',
},
{

View File

@@ -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'))