0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.0595: Vim9: not all commands using ends_excmd() tested

Problem:    Vim9: not all commands using ends_excmd() tested.
Solution:   Find # comment after regular commands. Add more tests.  Report
            error for where it was caused.
This commit is contained in:
Bram Moolenaar
2020-04-18 19:53:28 +02:00
parent b6fb0516ec
commit a26b9700d7
10 changed files with 122 additions and 15 deletions

View File

@@ -1836,7 +1836,8 @@ do_one_cmd(
*/
if (*ea.cmd == NUL || *ea.cmd == '"'
#ifdef FEAT_EVAL
|| (*ea.cmd == '#' && !starts_with_colon && in_vim9script())
|| (*ea.cmd == '#' && ea.cmd[1] != '{'
&& !starts_with_colon && in_vim9script())
#endif
|| (ea.nextcmd = check_nextcmd(ea.cmd)) != NULL)
{
@@ -4436,6 +4437,10 @@ separate_nextcmd(exarg_T *eap)
|| p != eap->arg)
&& (eap->cmdidx != CMD_redir
|| p != eap->arg + 1 || p[-1] != '@'))
#ifdef FEAT_EVAL
|| (*p == '#' && in_vim9script()
&& p[1] != '{' && p > eap->cmd && VIM_ISWHITE(p[-1]))
#endif
|| *p == '|' || *p == '\n')
{
/*
@@ -4790,7 +4795,7 @@ ends_excmd2(char_u *cmd_start UNUSED, char_u *cmd)
int c = *cmd;
#ifdef FEAT_EVAL
if (c == '#' && (cmd == cmd_start || VIM_ISWHITE(cmd[-1])))
if (c == '#' && cmd[1] != '{' && (cmd == cmd_start || VIM_ISWHITE(cmd[-1])))
return in_vim9script();
#endif
return (c == NUL || c == '|' || c == '"' || c == '\n');