1
0
forked from aniani/vim

patch 8.2.2022: Vim9: star command recognized errornously

Problem:    Vim9: star command recognized errornously.
Solution:   Give an error for missing colon. (issue #7335)
This commit is contained in:
Bram Moolenaar
2020-11-20 21:07:00 +01:00
parent eeece9e488
commit 95388e3179
3 changed files with 21 additions and 0 deletions

View File

@@ -3482,6 +3482,11 @@ find_ex_command(
break; break;
} }
// Not not recognize ":*" as the star command unless '*' is in
// 'cpoptions'.
if (eap->cmdidx == CMD_star && vim_strchr(p_cpo, CPO_STAR) == NULL)
p = eap->cmd;
// Look for a user defined command as a last resort. Let ":Print" be // Look for a user defined command as a last resort. Let ":Print" be
// overruled by a user defined command. // overruled by a user defined command.
if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print) if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print)

View File

@@ -634,5 +634,19 @@ def Test_f_args()
CheckScriptSuccess(lines) CheckScriptSuccess(lines)
enddef enddef
def Test_star_command()
var lines =<< trim END
vim9script
@s = 'g:success = 8'
set cpo+=*
exe '*s'
assert_equal(8, g:success)
unlet g:success
set cpo-=*
assert_fails("exe '*s'", 'E1050:')
END
CheckScriptSuccess(lines)
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2022,
/**/ /**/
2021, 2021,
/**/ /**/