diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-01-02 19:44:56 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-01-02 19:44:56 +0100 |
commit | a11919fa44fb43e947ef7871f31096a79429ec8a (patch) | |
tree | 1a3dcff40c36ca73029bb02b51f9a3283701ecb8 | |
parent | 9d19e4f4ba55f8bef18d4991abdf740ff6472dba (diff) |
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by barv8.2.2281
Problem: Vim9: compiled "wincmd" cannot be followed by bar.
Solution: Check for bar after "wincmd". (closes #7599)
-rw-r--r-- | src/testdir/test_vim9_cmd.vim | 10 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9compile.c | 14 |
3 files changed, 26 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index 095158c517..ab31100682 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -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 diff --git a/src/version.c b/src/version.c index 4d31dc7f2a..b54cf0a395 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2281, +/**/ 2280, /**/ 2279, diff --git a/src/vim9compile.c b/src/vim9compile.c index 23da8f2d11..2a2b44eac4 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -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) |