summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-08-14 21:35:40 +0200
committerBram Moolenaar <Bram@vim.org>2021-08-14 21:35:40 +0200
commit2596a4e763e11eb8e406f262cb72fd2b39461572 (patch)
treeab7c8ca904bc2262bc7a4c80e57489fbcf07b43e
parent6aa57295cfbe8f21c15f0671e45fd53cf990d404 (diff)
patch 8.2.3346: Vim9: no error for using "." for concatenation after ":vim9cmd"v8.2.3346
Problem: Vim9: no error for using "." for concatenation after ":vim9cmd". (Naohiro Ono) Solution: Check for Vim9 script syntax. (closes #8756)
-rw-r--r--src/eval.c3
-rw-r--r--src/testdir/test_vim9_cmd.vim1
-rw-r--r--src/version.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 1fd4765c76..020f55720c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2860,7 +2860,8 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
// "++" and "--" on the next line are a separate command.
p = eval_next_non_blank(*arg, evalarg, &getnext);
op = *p;
- concat = op == '.' && (*(p + 1) == '.' || current_sctx.sc_version < 2);
+ concat = op == '.' && (*(p + 1) == '.'
+ || (current_sctx.sc_version < 2 && !vim9script));
if ((op != '+' && op != '-' && !concat) || p[1] == '='
|| (p[1] == '.' && p[2] == '='))
break;
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim
index 7ec43e9d58..49bb8739f8 100644
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -14,6 +14,7 @@ def Test_vim9cmd()
END
CheckScriptSuccess(lines)
assert_fails('vim9cmd', 'E1164:')
+ assert_fails('vim9cmd echo "con" . "cat"', 'E15:')
lines =<< trim END
vim9script
diff --git a/src/version.c b/src/version.c
index b649014645..a2a229bf50 100644
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3346,
+/**/
3345,
/**/
3344,