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

patch 8.0.0490: vertical split makes 'winfixwidth' window smaller

Problem:    Splitting a 'winfixwidth' window vertically makes it one column
            smaller. (Dominique Pelle)
Solution:   Add one to the width for the separator.
This commit is contained in:
Bram Moolenaar 2017-03-19 20:22:36 +01:00
parent 7dd4850698
commit 38e3483637
3 changed files with 7 additions and 11 deletions

View File

@ -294,20 +294,14 @@ func Test_window_width()
set winfixwidth set winfixwidth
vsplit Xc vsplit Xc
let [ww1, ww2, ww3] = [winwidth(1), winwidth(2), winwidth(3)] let [ww1, ww2, ww3] = [winwidth(1), winwidth(2), winwidth(3)]
" FIXME: commented out: I would expect the width of 2nd window to call assert_equal(2, winwidth(2))
" remain 2 but it's actually 1?!
"call assert_equal(2, winwidth(2))
call assert_inrange(ww3, ww3 + 1, ww1) call assert_inrange(ww3, ww3 + 1, ww1)
3wincmd > 3wincmd >
" FIXME: commented out: I would expect the width of 2nd window to call assert_equal(2, winwidth(2))
" remain 2 but it's actually 1?!
"call assert_equal(2, winwidth(2))
call assert_equal(ww1 + 3, winwidth(1)) call assert_equal(ww1 + 3, winwidth(1))
call assert_equal(ww3 - 3, winwidth(3)) call assert_equal(ww3 - 3, winwidth(3))
wincmd = wincmd =
" FIXME: commented out: I would expect the width of 2nd window to call assert_equal(2, winwidth(2))
" remain 2 but it's actually 1?!
"call assert_equal(2, winwidth(2))
call assert_equal(ww1, winwidth(1)) call assert_equal(ww1, winwidth(1))
call assert_equal(ww3, winwidth(3)) call assert_equal(ww3, winwidth(3))

View File

@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
490,
/**/ /**/
489, 489,
/**/ /**/

View File

@ -870,9 +870,9 @@ win_split_ins(
/* We don't like to take lines for the new window from a /* We don't like to take lines for the new window from a
* 'winfixwidth' window. Take them from a window to the left or right * 'winfixwidth' window. Take them from a window to the left or right
* instead, if possible. */ * instead, if possible. Add one for the separator. */
if (oldwin->w_p_wfw) if (oldwin->w_p_wfw)
win_setwidth_win(oldwin->w_width + new_size, oldwin); win_setwidth_win(oldwin->w_width + new_size + 1, oldwin);
/* Only make all windows the same width if one of them (except oldwin) /* Only make all windows the same width if one of them (except oldwin)
* is wider than one of the split windows. */ * is wider than one of the split windows. */