]> granicus.if.org Git - vim/commitdiff
patch 8.2.2245: Vim9: return value of winrestcmd() cannot be executed v8.2.2245
authorBram Moolenaar <Bram@vim.org>
Tue, 29 Dec 2020 19:25:19 +0000 (20:25 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 29 Dec 2020 19:25:19 +0000 (20:25 +0100)
Problem:    Vim9: return value of winrestcmd() cannot be executed.
Solution:   Put colons before each range. (closes #7571)

src/evalwindow.c
src/testdir/test_vim9_builtin.vim
src/version.c

index 884f4091a133bbbf14cea04a358b4be1554e506a..492269ede430f66874c3d6400d113fc8ad85e79f 100644 (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;
     }
index 4abdcdba640b19ba0508ed73507548c41f1fafb4..3fd3e6dca6a6883f498447fa4d04639679c05470 100644 (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
index 20bd86f763ff1115416aecbea5ec74442463c403..bee026c197b663cb582b55b7f5ae98831df08a6e 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2245,
 /**/
     2244,
 /**/