mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.2806: Vim9: using "++nr" as a command might not work
Problem: Vim9: using "++nr" as a command might not work. Solution: Do not recognize "++" and "--" in a following line as addition or subtraction.
This commit is contained in:
@@ -2856,12 +2856,15 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
|
||||
// "." is only string concatenation when scriptversion is 1
|
||||
// "+=", "-=" and "..=" are assignments
|
||||
// "++" and "--" on the next line are a separate command.
|
||||
p = eval_next_non_blank(*arg, evalarg, &getnext);
|
||||
op = *p;
|
||||
concat = op == '.' && (*(p + 1) == '.' || current_sctx.sc_version < 2);
|
||||
if ((op != '+' && op != '-' && !concat) || p[1] == '='
|
||||
|| (p[1] == '.' && p[2] == '='))
|
||||
break;
|
||||
if (getnext && (op == '+' || op == '-') && p[0] == p[1])
|
||||
break;
|
||||
|
||||
evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
|
||||
oplen = (concat && p[1] == '.') ? 2 : 1;
|
||||
|
Reference in New Issue
Block a user