summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-14 18:35:18 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-14 18:35:18 +0200
commit2b22b113c6aedf2a1295cf7e6f2f2a5d463b3868 (patch)
treebed5e5dcc7accc8d660be8c7ceebdab48c73fb7d
parentdbeecb2b6bc5bf90b7345807e0a313fe890a7c7b (diff)
downloadvim-git-2b22b113c6aedf2a1295cf7e6f2f2a5d463b3868.tar.gz
patch 8.2.1683: Vim9: assignment test failsv8.2.1683
Problem: Vim9: assignment test fails. Solution: Include changes to find Ex command.
-rw-r--r--src/ex_docmd.c28
-rw-r--r--src/version.c2
2 files changed, 23 insertions, 7 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index ed52b464b..bc01b69c7 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3224,19 +3224,33 @@ find_ex_command(
// "g:varname" is an expression.
|| eap->cmd[1] == ':'
)
- : (
- // "varname[]" is an expression.
- *p == '['
// "varname->func()" is an expression.
- || (*p == '-' && p[1] == '>')
- // "varname.expr" is an expression.
- || (*p == '.' && ASCII_ISALPHA(p[1]))
- )))
+ : (*p == '-' && p[1] == '>')))
{
eap->cmdidx = CMD_eval;
return eap->cmd;
}
+ if (p != eap->cmd && (
+ // "varname[]" is an expression.
+ *p == '['
+ // "varname.key" is an expression.
+ || (*p == '.' && ASCII_ISALPHA(p[1]))))
+ {
+ char_u *after = p;
+
+ // When followed by "=" or "+=" then it is an assignment.
+ ++emsg_silent;
+ if (skip_expr(&after) == OK
+ && (*after == '='
+ || (*after != NUL && after[1] == '=')))
+ eap->cmdidx = CMD_let;
+ else
+ eap->cmdidx = CMD_eval;
+ --emsg_silent;
+ return eap->cmd;
+ }
+
// "[...]->Method()" is a list expression, but "[a, b] = Func()" is
// an assignment.
// If there is no line break inside the "[...]" then "p" is
diff --git a/src/version.c b/src/version.c
index d5996e957..1b05536d4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1683,
+/**/
1682,
/**/
1681,