diff options
-rw-r--r-- | src/ex_docmd.c | 28 | ||||
-rw-r--r-- | src/version.c | 2 |
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, |