]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1979: :helpclose allows range and counts v9.1.1979
authorDoug Kearns <dougkearns@gmail.com>
Sun, 14 Dec 2025 15:41:03 +0000 (16:41 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 14 Dec 2025 15:41:03 +0000 (16:41 +0100)
Problem:  :helpclose incorrectly accepts a range and a count.
Solution: Remove EX_COUNT and EX_RANGE from the command definition.
          (Doug Kearns)

closes: #18917

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ex_cmds.h
src/testdir/test_help.vim
src/version.c

index d588be3b95f471adbf32b55a5107845af57d3c10..48b69ea824ff09da173950f702a6bfde25acba26 100644 (file)
@@ -693,8 +693,8 @@ EXCMD(CMD_help,             "help",         ex_help,
        EX_BANG|EX_EXTRA|EX_NOTRLCOM,
        ADDR_NONE),
 EXCMD(CMD_helpclose,   "helpclose",    ex_helpclose,
-       EX_RANGE|EX_COUNT|EX_TRLBAR,
-       ADDR_OTHER),
+       EX_TRLBAR,
+       ADDR_NONE),
 EXCMD(CMD_helpfind,    "helpfind",     ex_helpfind,
        EX_EXTRA|EX_NOTRLCOM,
        ADDR_NONE),
index 820338abdc4cbfcafba21b1f7825f857abd5bfc5..33e5234b525d286536b7f3a7f3a0024eeb576068 100644 (file)
@@ -58,6 +58,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('eval.txt', expand('%:t'))
index 5c19e6baa232f05921f53ced120ac3161ea1f4c2..d62c453f1bad2ebdc150437745a875f7b0850243 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1979,
 /**/
     1978,
 /**/