int save_reg_executing = reg_executing;
int ni; // set when Not Implemented
char_u *cmd;
+#ifdef FEAT_EVAL
+ int starts_with_colon;
+#endif
vim_memset(&ea, 0, sizeof(ea));
ea.line1 = 1;
ea.cookie = cookie;
#ifdef FEAT_EVAL
ea.cstack = cstack;
+ starts_with_colon = *skipwhite(ea.cmd) == ':';
#endif
if (parse_command_modifiers(&ea, &errormsg, FALSE) == FAIL)
goto doend;
ea.cmd = skipwhite(ea.cmd + 1);
#ifdef FEAT_EVAL
- if (current_sctx.sc_version == SCRIPT_VERSION_VIM9)
+ if (current_sctx.sc_version == SCRIPT_VERSION_VIM9 && !starts_with_colon)
p = find_ex_command(&ea, NULL, lookup_scriptvar, NULL);
else
#endif
setline(1, 'something')
:substitute(some(other(
assert_equal('otherthing', getline(1))
+ bwipe!
+
+ " also when the context is Vim9 script
+ let lines =<< trim END
+ vim9script
+ new
+ setline(1, 'something')
+ :substitute(some(other(
+ assert_equal('otherthing', getline(1))
+ bwipe!
+ END
+ writefile(lines, 'Xvim9lines')
+ source Xvim9lines
+
+ delete('Xvim9lines')
enddef