Mercurial > vim
changeset 22616:f773ac13c093 v8.2.1856
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 17 Oct 2020 17:45:04 +0200 |
parents | 18958d4b31d1 |
children | c1bb78e32bf1 |
files | src/ex_docmd.c src/testdir/test_window_cmd.vim src/version.c |
diffstat | 3 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -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);
--- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -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