diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-24 19:08:24 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-24 19:08:24 +0200 |
commit | bdc0f1c6986e5d64f647e0924a4de795b47c549a (patch) | |
tree | d314ca4f02d7e8e13072ebef2ed4ba92be403083 /src/ex_docmd.c | |
parent | 96cf4ba8fb96e5778192d2dab7458b9a7da0a49d (diff) |
patch 8.2.2806: Vim9: using "++nr" as a command might not workv8.2.2806
Problem: Vim9: using "++nr" as a command might not work.
Solution: Do not recognize "++" and "--" in a following line as addition or
subtraction.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 0d87a89440..85fecbbbf1 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3531,6 +3531,13 @@ find_ex_command( 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 |