]> granicus.if.org Git - vim/commitdiff
patch 8.0.0490: vertical split makes 'winfixwidth' window smaller v8.0.0490
authorBram Moolenaar <Bram@vim.org>
Sun, 19 Mar 2017 19:22:36 +0000 (20:22 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 19 Mar 2017 19:22:36 +0000 (20:22 +0100)
Problem:    Splitting a 'winfixwidth' window vertically makes it one column
            smaller. (Dominique Pelle)
Solution:   Add one to the width for the separator.

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

index 58d13901627aaa0d6bd614b2769ed8eaec4d15a4..f7d5317f23e3712a3d4f186eb12a3cac406cd41c 100644 (file)
@@ -294,20 +294,14 @@ func Test_window_width()
   set winfixwidth
   vsplit Xc
   let [ww1, ww2, ww3] = [winwidth(1), winwidth(2), winwidth(3)]
-  " FIXME: commented out: I would expect the width of 2nd window to 
-  " remain 2 but it's actually 1?!
-  "call assert_equal(2, winwidth(2))
+  call assert_equal(2, winwidth(2))
   call assert_inrange(ww3, ww3 + 1, ww1)
   3wincmd >
-  " FIXME: commented out: I would expect the width of 2nd window to 
-  " remain 2 but it's actually 1?!
-  "call assert_equal(2,       winwidth(2))
+  call assert_equal(2,       winwidth(2))
   call assert_equal(ww1 + 3, winwidth(1))
   call assert_equal(ww3 - 3, winwidth(3))
   wincmd =
-  " FIXME: commented out: I would expect the width of 2nd window to 
-  " remain 2 but it's actually 1?!
-  "call assert_equal(2,   winwidth(2))
+  call assert_equal(2,   winwidth(2))
   call assert_equal(ww1, winwidth(1))
   call assert_equal(ww3, winwidth(3))
 
index dd6e366a75f2454301ef5e1edd3c329f7f27fc88..e009e8e63736677fd260441c0b6302dfa69ecb7f 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    490,
 /**/
     489,
 /**/
index 867f0636a905a7d7f4e0d6377c1b7201a0480a01..eed0ea9e7d71cbc58f5c12379dd88075e4c8e229 100644 (file)
@@ -870,9 +870,9 @@ win_split_ins(
 
        /* 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
-        * instead, if possible. */
+        * instead, if possible. Add one for the separator. */
        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)
         * is wider than one of the split windows. */