mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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)
This commit is contained in:
@@ -2860,7 +2860,8 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
|||||||
// "++" and "--" on the next line are a separate command.
|
// "++" and "--" on the next line are a separate command.
|
||||||
p = eval_next_non_blank(*arg, evalarg, &getnext);
|
p = eval_next_non_blank(*arg, evalarg, &getnext);
|
||||||
op = *p;
|
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] == '='
|
if ((op != '+' && op != '-' && !concat) || p[1] == '='
|
||||||
|| (p[1] == '.' && p[2] == '='))
|
|| (p[1] == '.' && p[2] == '='))
|
||||||
break;
|
break;
|
||||||
|
@@ -14,6 +14,7 @@ def Test_vim9cmd()
|
|||||||
END
|
END
|
||||||
CheckScriptSuccess(lines)
|
CheckScriptSuccess(lines)
|
||||||
assert_fails('vim9cmd', 'E1164:')
|
assert_fails('vim9cmd', 'E1164:')
|
||||||
|
assert_fails('vim9cmd echo "con" . "cat"', 'E15:')
|
||||||
|
|
||||||
lines =<< trim END
|
lines =<< trim END
|
||||||
vim9script
|
vim9script
|
||||||
|
@@ -755,6 +755,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3346,
|
||||||
/**/
|
/**/
|
||||||
3345,
|
3345,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user