]> granicus.if.org Git - vim/commitdiff
patch 8.2.1856: "2resize" uses size of current window v8.2.1856
authorBram Moolenaar <Bram@vim.org>
Sat, 17 Oct 2020 15:39:55 +0000 (17:39 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 17 Oct 2020 15:39:55 +0000 (17:39 +0200)
Problem:    "2resize" uses size of current window.
Solution:   Use size of resized window. (Yasuhiro Matsumoto, closes #7152)

src/ex_docmd.c
src/testdir/test_window_cmd.vim
src/version.c

index 66c0b667aec33975a673dde2cfa24e8cec33cb3c..1ccd38ec90bb8ac1210591101d99f9443b7aa84c 100644 (file)
@@ -6365,7 +6365,7 @@ ex_resize(exarg_T *eap)
     if (cmdmod.split & WSP_VERT)
     {
        if (*eap->arg == '-' || *eap->arg == '+')
-           n += curwin->w_width;
+           n += wp->w_width;
        else if (n == 0 && eap->arg[0] == NUL)  // default is very wide
            n = 9999;
        win_setwidth_win((int)n, wp);
@@ -6373,7 +6373,7 @@ ex_resize(exarg_T *eap)
     else
     {
        if (*eap->arg == '-' || *eap->arg == '+')
-           n += curwin->w_height;
+           n += wp->w_height;
        else if (n == 0 && eap->arg[0] == NUL)  // default is very high
            n = 9999;
        win_setheight_win((int)n, wp);
index a4b4f5319f72826b7d479b069653c15f113e9d0b..51d0722722013347d38cc2c93d90356f3dfff261 100644 (file)
@@ -1144,6 +1144,10 @@ func Test_window_resize()
   exe other_winnr .. 'resize 10'
   call assert_equal(10, winheight(other_winnr))
   call assert_equal(&lines - 10 - 3, winheight(0))
+  exe other_winnr .. 'resize +1'
+  exe other_winnr .. 'resize +1'
+  call assert_equal(12, winheight(other_winnr))
+  call assert_equal(&lines - 10 - 3 -2, winheight(0))
 
   %bwipe!
 endfunc
index cc9876911a853ab1fd1d74775dd64f607dfe8b40..ff532f1f7cf3a24a57a46db8bfb6bda49189021e 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1856,
 /**/
     1855,
 /**/