diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-03-05 20:24:41 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-05 20:24:41 +0000 |
commit | b2175220dafc28349b275ac7f3080f89cce78a57 (patch) | |
tree | 3ffc364a08fa4c0961a1b38b9a2d0547b6895e18 /src/ex_docmd.c | |
parent | b29ae159777028bb3266835b55716749ab0515be (diff) | |
download | vim-git-b2175220dafc28349b275ac7f3080f89cce78a57.tar.gz |
patch 8.2.4514: Vim9: some flow commands can be shortenedv8.2.4514
Problem: Vim9: some flow commands can be shortened.
Solution: Also require using the full name for ":return", ":enddef",
":continue", ":export" and ":import".
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 6b2bdd4e5..4066f8de9 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3753,16 +3753,14 @@ find_ex_command( // :Print and :mode are not supported in Vim9 script. // Some commands cannot be shortened in Vim9 script. - // ":continue" needs at least ":cont", since ":con" looks weird. if (vim9 && eap->cmdidx != CMD_SIZE) { if (eap->cmdidx == CMD_mode || eap->cmdidx == CMD_Print) eap->cmdidx = CMD_SIZE; - else if (((cmdnames[eap->cmdidx].cmd_argt & EX_WHOLE) + else if ((cmdnames[eap->cmdidx].cmd_argt & EX_WHOLE) && len < (int)STRLEN(cmdnames[eap->cmdidx].cmd_name)) - || (eap->cmdidx == CMD_continue && len < 4)) { - semsg(_(e_command_cannot_be_shortened), eap->cmd); + semsg(_(e_command_cannot_be_shortened_str), eap->cmd); eap->cmdidx = CMD_SIZE; } } |