Skip to content

Commit 2596a4e

Browse files
committed
patch 8.2.3346: Vim9: no error for using "." for concatenation after ":vim9cmd"
Problem: Vim9: no error for using "." for concatenation after ":vim9cmd". (Naohiro Ono) Solution: Check for Vim9 script syntax. (closes #8756)
1 parent 6aa5729 commit 2596a4e

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/eval.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2860,7 +2860,8 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
28602860
// "++" and "--" on the next line are a separate command.
28612861
p = eval_next_non_blank(*arg, evalarg, &getnext);
28622862
op = *p;
2863-
concat = op == '.' && (*(p + 1) == '.' || current_sctx.sc_version < 2);
2863+
concat = op == '.' && (*(p + 1) == '.'
2864+
|| (current_sctx.sc_version < 2 && !vim9script));
28642865
if ((op != '+' && op != '-' && !concat) || p[1] == '='
28652866
|| (p[1] == '.' && p[2] == '='))
28662867
break;

src/testdir/test_vim9_cmd.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def Test_vim9cmd()
1414
END
1515
CheckScriptSuccess(lines)
1616
assert_fails('vim9cmd', 'E1164:')
17+
assert_fails('vim9cmd echo "con" . "cat"', 'E15:')
1718

1819
lines =<< trim END
1920
vim9script

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3346,
758760
/**/
759761
3345,
760762
/**/

0 commit comments

Comments
 (0)