]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0966: Vim9: :enum command can be shortened v9.1.0966
authorh-east <h.east.727@gmail.com>
Fri, 27 Dec 2024 15:25:32 +0000 (16:25 +0100)
committerChristian Brabandt <cb@256bit.org>
Fri, 27 Dec 2024 15:25:32 +0000 (16:25 +0100)
Problem:  Vim9: :enum command can be shortened
Solution: prevent shortening of :enum command by adding the EX_WHOLE
          flag to command definition (h-east)

closes: #16305

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ex_cmds.h
src/testdir/test_vim9_enum.vim
src/version.c

index dc5da0a1e40be42ffdf2adae3589fe5ad334cc29..92a40f20a246a2bef1530bddafaace8b4da42177 100644 (file)
@@ -597,7 +597,7 @@ EXCMD(CMD_enew,             "enew",         ex_edit,
        EX_BANG|EX_TRLBAR,
        ADDR_NONE),
 EXCMD(CMD_enum,                "enum",         ex_class,
-       EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
+       EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_WHOLE|EX_EXPORT,
        ADDR_NONE),
 EXCMD(CMD_eval,                "eval",         ex_eval,
        EX_EXTRA|EX_NOTRLCOM|EX_EXPR_ARG|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
index bc54bee3a97e63a99e6269cc9b284f343b237cc1..a5fb26fcf393856d523518675611b904804e947c 100644 (file)
@@ -44,6 +44,14 @@ def Test_enum_parse()
   END
   v9.CheckSourceFailure(lines, 'E492: Not an editor command: enums Something', 2)
 
+  # The complete "enum" should be specified.
+  lines =<< trim END
+    vim9script
+    enu Something
+    endenum
+  END
+  v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: enu', 2)
+
   # The complete "endenum" should be specified.
   lines =<< trim END
     vim9script
index 622a0a1c663f98005c107e49eb622b8687c6ce30..8b9036538e8a0ce01b74a540d267024c8f1e4780 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    966,
 /**/
     965,
 /**/