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.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 0d87a89..85fecbb 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3531,6 +3531,13 @@
eap->cmdidx = CMD_eval;
return eap->cmd;
}
+
+ // Check for "++nr" and "--nr".
+ if (p == eap->cmd && p[0] == p[1] && (*p == '+' || *p == '-'))
+ {
+ eap->cmdidx = *p == '+' ? CMD_increment : CMD_decrement;
+ return eap->cmd + 2;
+ }
}
#endif