0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places

Problem:    Vim9: cannot use Vim9 script syntax in some places.
Solution:   Add the :vim9cmd command modifier. Incompatible: Makes ":vim9"
            mean ":vim9cmd" instead of ":vim9script".
This commit is contained in:
Bram Moolenaar
2021-02-14 12:57:36 +01:00
parent 10ccfb2a17
commit 39f3b14110
15 changed files with 56 additions and 18 deletions

View File

@@ -1737,7 +1737,7 @@ do_one_cmd(
int starts_with_colon = FALSE;
#ifdef FEAT_EVAL
int may_have_range;
int vim9script = in_vim9script();
int vim9script;
int did_set_expr_line = FALSE;
#endif
int sourcing = flags & DOCMD_VERBOSE;
@@ -1785,7 +1785,7 @@ do_one_cmd(
if (parse_command_modifiers(&ea, &errormsg, &cmdmod, FALSE) == FAIL)
goto doend;
apply_cmdmod(&cmdmod);
vim9script = in_vim9script();
after_modifier = ea.cmd;
#ifdef FEAT_EVAL
@@ -2933,6 +2933,17 @@ parse_command_modifiers(
cmod->cmod_split |= WSP_VERT;
continue;
}
if (checkforcmd(&eap->cmd, "vim9cmd", 4))
{
if (ends_excmd2(p, eap->cmd))
{
*errormsg =
_(e_vim9cmd_must_be_followed_by_command);
return FAIL;
}
cmod->cmod_flags |= CMOD_VIM9CMD;
continue;
}
if (!checkforcmd(&p, "verbose", 4))
break;
if (vim_isdigit(*eap->cmd))