0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar

Problem:    Vim9: compiled "wincmd" cannot be followed by bar.
Solution:   Check for bar after "wincmd". (closes #7599)
This commit is contained in:
Bram Moolenaar
2021-01-02 19:44:56 +01:00
parent 9d19e4f4ba
commit a11919fa44
3 changed files with 26 additions and 0 deletions

View File

@@ -868,4 +868,14 @@ def Test_insert_complete()
bwipe!
enddef
def Test_wincmd()
split
var id1 = win_getid()
if true
try | wincmd w | catch | endtry
endif
assert_notequal(id1, win_getid())
close
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2281,
/**/
2280,
/**/

View File

@@ -7329,6 +7329,20 @@ compile_exec(char_u *line, exarg_T *eap, cctx_T *cctx)
if (eap->nextcmd != NULL)
nextcmd = eap->nextcmd;
}
else if (eap->cmdidx == CMD_wincmd)
{
p = eap->arg;
if (*p != NUL)
++p;
if (*p == 'g' || *p == Ctrl_G)
++p;
p = skipwhite(p);
if (*p == '|')
{
*p = NUL;
nextcmd = p + 1;
}
}
}
if (eap->cmdidx == CMD_syntax && STRNCMP(eap->arg, "include ", 8) == 0)