forked from aniani/vim
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Problem: Vim9: command modifiers in :def function not tested. Solution: Add tests. Fix using modifier before filter command.
This commit is contained in:
@@ -1782,14 +1782,27 @@ do_one_cmd(
|
||||
*/
|
||||
cmd = ea.cmd;
|
||||
#ifdef FEAT_EVAL
|
||||
// In Vim9 script a colon is required before the range.
|
||||
may_have_range = !vim9script || starts_with_colon;
|
||||
// In Vim9 script a colon is required before the range. This may also be
|
||||
// after command modifiers.
|
||||
if (vim9script)
|
||||
{
|
||||
may_have_range = FALSE;
|
||||
for (p = ea.cmd; p >= *cmdlinep; --p)
|
||||
{
|
||||
if (*p == ':')
|
||||
may_have_range = TRUE;
|
||||
if (p < ea.cmd && !VIM_ISWHITE(*p))
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
may_have_range = TRUE;
|
||||
if (may_have_range)
|
||||
#endif
|
||||
ea.cmd = skip_range(ea.cmd, TRUE, NULL);
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
if (vim9script && !starts_with_colon)
|
||||
if (vim9script && !may_have_range)
|
||||
{
|
||||
if (ea.cmd == cmd + 1 && *cmd == '$')
|
||||
// should be "$VAR = val"
|
||||
|
Reference in New Issue
Block a user