0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.2245: Vim9: return value of winrestcmd() cannot be executed

Problem:    Vim9: return value of winrestcmd() cannot be executed.
Solution:   Put colons before each range. (closes #7571)
This commit is contained in:
Bram Moolenaar 2020-12-29 20:25:19 +01:00
parent 89015a6759
commit 285b15fce1
3 changed files with 14 additions and 2 deletions

View File

@ -1010,9 +1010,9 @@ f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
ga_init2(&ga, (int)sizeof(char), 70);
FOR_ALL_WINDOWS(wp)
{
sprintf((char *)buf, "%dresize %d|", winnr, wp->w_height);
sprintf((char *)buf, ":%dresize %d|", winnr, wp->w_height);
ga_concat(&ga, buf);
sprintf((char *)buf, "vert %dresize %d|", winnr, wp->w_width);
sprintf((char *)buf, "vert :%dresize %d|", winnr, wp->w_width);
ga_concat(&ga, buf);
++winnr;
}

View File

@ -716,5 +716,15 @@ def Test_win_splitmove()
close
enddef
def Test_winrestcmd()
split
var cmd = winrestcmd()
wincmd _
exe cmd
assert_equal(cmd, winrestcmd())
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 */
/**/
2245,
/**/
2244,
/**/