comparison src/ex_docmd.c @ 24533:9c404d78d767 v8.2.2806

patch 8.2.2806: Vim9: using "++nr" as a command might not work Commit: https://github.com/vim/vim/commit/bdc0f1c6986e5d64f647e0924a4de795b47c549a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 24 19:08:24 2021 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Sat, 24 Apr 2021 19:15:04 +0200
parents 3bfec39ce31c
children f522ef9e5ea3
comparison
equal deleted inserted replaced
24532:7660cdae6683 24533:9c404d78d767
3529 || (ASCII_ISALPHA(eap->cmd[0]) && eap->cmd[1] == ':'))) 3529 || (ASCII_ISALPHA(eap->cmd[0]) && eap->cmd[1] == ':')))
3530 { 3530 {
3531 eap->cmdidx = CMD_eval; 3531 eap->cmdidx = CMD_eval;
3532 return eap->cmd; 3532 return eap->cmd;
3533 } 3533 }
3534
3535 // Check for "++nr" and "--nr".
3536 if (p == eap->cmd && p[0] == p[1] && (*p == '+' || *p == '-'))
3537 {
3538 eap->cmdidx = *p == '+' ? CMD_increment : CMD_decrement;
3539 return eap->cmd + 2;
3540 }
3534 } 3541 }
3535 #endif 3542 #endif
3536 3543
3537 /* 3544 /*
3538 * Isolate the command and search for it in the command table. 3545 * Isolate the command and search for it in the command table.