forked from aniani/vim
patch 8.2.2066: Vim9: assignment with += doesn't work
Problem: Vim9: assignment with += doesn't work. Solution: Do not see the "+" as an addition operator.
This commit is contained in:
@@ -2769,10 +2769,11 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
int vim9script = in_vim9script();
|
||||
|
||||
// "." is only string concatenation when scriptversion is 1
|
||||
// "+=" and "-=" are assignment
|
||||
p = eval_next_non_blank(*arg, evalarg, &getnext);
|
||||
op = *p;
|
||||
concat = op == '.' && (*(p + 1) == '.' || current_sctx.sc_version < 2);
|
||||
if (op != '+' && op != '-' && !concat)
|
||||
if ((op != '+' && op != '-' && !concat) || p[1] == '=')
|
||||
break;
|
||||
|
||||
evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
|
||||
|
Reference in New Issue
Block a user