Skip to content

Commit 38e3483

Browse files
committed
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.
1 parent 7dd4850 commit 38e3483

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

src/testdir/test_window_cmd.vim

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,20 +294,14 @@ func Test_window_width()
294294
set winfixwidth
295295
vsplit Xc
296296
let [ww1, ww2, ww3] = [winwidth(1), winwidth(2), winwidth(3)]
297-
" FIXME: commented out: I would expect the width of 2nd window to
298-
" remain 2 but it's actually 1?!
299-
"call assert_equal(2, winwidth(2))
297+
call assert_equal(2, winwidth(2))
300298
call assert_inrange(ww3, ww3 + 1, ww1)
301299
3wincmd >
302-
" FIXME: commented out: I would expect the width of 2nd window to
303-
" remain 2 but it's actually 1?!
304-
"call assert_equal(2, winwidth(2))
300+
call assert_equal(2, winwidth(2))
305301
call assert_equal(ww1 + 3, winwidth(1))
306302
call assert_equal(ww3 - 3, winwidth(3))
307303
wincmd =
308-
" FIXME: commented out: I would expect the width of 2nd window to
309-
" remain 2 but it's actually 1?!
310-
"call assert_equal(2, winwidth(2))
304+
call assert_equal(2, winwidth(2))
311305
call assert_equal(ww1, winwidth(1))
312306
call assert_equal(ww3, winwidth(3))
313307

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
490,
767769
/**/
768770
489,
769771
/**/

src/window.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,9 +870,9 @@ win_split_ins(
870870

871871
/* We don't like to take lines for the new window from a
872872
* 'winfixwidth' window. Take them from a window to the left or right
873-
* instead, if possible. */
873+
* instead, if possible. Add one for the separator. */
874874
if (oldwin->w_p_wfw)
875-
win_setwidth_win(oldwin->w_width + new_size, oldwin);
875+
win_setwidth_win(oldwin->w_width + new_size + 1, oldwin);
876876

877877
/* Only make all windows the same width if one of them (except oldwin)
878878
* is wider than one of the split windows. */

0 commit comments

Comments
 (0)