summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-02-23 14:35:01 +0100
committerBram Moolenaar <Bram@vim.org>2020-02-23 14:35:01 +0100
commit83f37b91426b419a913aa4f42d041b2111b57864 (patch)
tree6d508483d9e6ca68f2cbab5d11a282003fe60c0a /src/ex_docmd.c
parent8040a7147f5b896a702d1684e7831df107490f45 (diff)
patch 8.2.0306: Vim9: :substitute(pat(repl does not work in Vim9 scriptv8.2.0306
Problem: Vim9: :substitute(pat(repl does not work in Vim9 script. Solution: Remember starting with a colon. (closes #5676)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 70c0da2f03..62cab6e22f 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1647,6 +1647,9 @@ do_one_cmd(
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;
@@ -1689,6 +1692,7 @@ do_one_cmd(
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;
@@ -1713,7 +1717,7 @@ do_one_cmd(
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