• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisionf773ac13c093c27cb9cb0bd19eb90917a41aad53 (tree)
Time2020-10-18 00:45:04
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.1856: "2resize" uses size of current window

Commit: https://github.com/vim/vim/commit/9668cc57a1e70c99163f90f58202e206d12f40c8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 17 17:39:55 2020 +0200

patch 8.2.1856: "2resize" uses size of current window
Problem: "2resize" uses size of current window.
Solution: Use size of resized window. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/7152)

Change Summary

Incremental Difference

diff -r 18958d4b31d1 -r f773ac13c093 src/ex_docmd.c
--- a/src/ex_docmd.c Fri Oct 16 23:30:04 2020 +0200
+++ b/src/ex_docmd.c Sat Oct 17 17:45:04 2020 +0200
@@ -6365,7 +6365,7 @@
63656365 if (cmdmod.split & WSP_VERT)
63666366 {
63676367 if (*eap->arg == '-' || *eap->arg == '+')
6368- n += curwin->w_width;
6368+ n += wp->w_width;
63696369 else if (n == 0 && eap->arg[0] == NUL) // default is very wide
63706370 n = 9999;
63716371 win_setwidth_win((int)n, wp);
@@ -6373,7 +6373,7 @@
63736373 else
63746374 {
63756375 if (*eap->arg == '-' || *eap->arg == '+')
6376- n += curwin->w_height;
6376+ n += wp->w_height;
63776377 else if (n == 0 && eap->arg[0] == NUL) // default is very high
63786378 n = 9999;
63796379 win_setheight_win((int)n, wp);
diff -r 18958d4b31d1 -r f773ac13c093 src/testdir/test_window_cmd.vim
--- a/src/testdir/test_window_cmd.vim Fri Oct 16 23:30:04 2020 +0200
+++ b/src/testdir/test_window_cmd.vim Sat Oct 17 17:45:04 2020 +0200
@@ -1144,6 +1144,10 @@
11441144 exe other_winnr .. 'resize 10'
11451145 call assert_equal(10, winheight(other_winnr))
11461146 call assert_equal(&lines - 10 - 3, winheight(0))
1147+ exe other_winnr .. 'resize +1'
1148+ exe other_winnr .. 'resize +1'
1149+ call assert_equal(12, winheight(other_winnr))
1150+ call assert_equal(&lines - 10 - 3 -2, winheight(0))
11471151
11481152 %bwipe!
11491153 endfunc
diff -r 18958d4b31d1 -r f773ac13c093 src/version.c
--- a/src/version.c Fri Oct 16 23:30:04 2020 +0200
+++ b/src/version.c Sat Oct 17 17:45:04 2020 +0200
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 1856,
755+/**/
754756 1855,
755757 /**/
756758 1854,
Show on old repository browser