1
0
forked from aniani/vim

patch 8.2.1851: Vim9: "!" followed by space incorrectly used

Problem:    Vim9: "!" followed by space incorrectly used.
Solution:   Skip over trailing spaces. (closes #7131)
This commit is contained in:
Bram Moolenaar
2020-10-15 21:54:56 +02:00
parent a604ccc959
commit 27491cd3ef
4 changed files with 28 additions and 6 deletions

View File

@@ -3041,7 +3041,7 @@ apply_leader(typval_T *rettv, int numeric_only, char_u *start, char_u **end)
++p;
break;
}
else
else if (*p == '!')
{
int v = tv2bool(rettv);
@@ -3178,12 +3178,13 @@ compile_leader(cctx_T *cctx, int numeric_only, char_u *start, char_u **end)
}
else
{
int invert = TRUE;
int invert = *p == '!';
while (p > start && p[-1] == '!')
while (p > start && (p[-1] == '!' || VIM_ISWHITE(p[-1])))
{
if (p[-1] == '!')
invert = !invert;
--p;
invert = !invert;
}
if (generate_2BOOL(cctx, invert) == FAIL)
return FAIL;