1
0
forked from aniani/vim

patch 8.2.3048: strange error for white space after ++ command

Problem:    Strange error for white space after ++ command.
Solution:   Check for white space explicitly. (closes #8440)
This commit is contained in:
Bram Moolenaar
2021-06-25 21:31:09 +02:00
parent f3d30842dc
commit 22480d147f
5 changed files with 23 additions and 0 deletions

View File

@@ -6639,6 +6639,12 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
}
if (eap->cmdidx == CMD_increment || eap->cmdidx == CMD_decrement)
{
if (VIM_ISWHITE(eap->cmd[2]))
{
semsg(_(e_no_white_space_allowed_after_str_str),
eap->cmdidx == CMD_increment ? "++" : "--", eap->cmd);
return NULL;
}
op = (char_u *)(eap->cmdidx == CMD_increment ? "+=" : "-=");
oplen = 2;
incdec = TRUE;