]> granicus.if.org Git - vim/commitdiff
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero v9.0.0403
authorLuuk van Baal <luukvbaal@gmail.com>
Wed, 7 Sep 2022 13:42:49 +0000 (14:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 7 Sep 2022 13:42:49 +0000 (14:42 +0100)
Problem:    'equalalways' may be off when 'laststatus' is zero.
Solution:   call last_status() before win_equal(). (Luuk van Baal,
            closes #11070)

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

index 44fd646392bfa6dc2aae37e0ad25d5274f2bd174..e38c8a8107897f20cf65a74918cea658d40ccdca 100644 (file)
@@ -1617,4 +1617,19 @@ func Test_window_alloc_failure()
   tabonly
 endfunc
 
+func Test_win_equal_last_status()
+  let save_lines = &lines
+  set lines=20
+  set splitbelow
+  set laststatus=0
+
+  split | split | quit
+  call assert_equal(winheight(1), winheight(2))
+
+  let &lines = save_lines
+  set splitbelow&
+  set laststatus&
+endfunc
+
+
 " vim: shiftwidth=2 sts=2 expandtab
index c06a43cf8e3598b1bef4d9ccce0d4f570fe58713..db1a1dec54ad3b08c0fd4ee00f241650c45f94b4 100644 (file)
@@ -703,6 +703,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    403,
 /**/
     402,
 /**/
index 36327350bda2c5de03a18ca60be12a78bee40680..ff55a3bf9fc6083f94c5368ca2a85da9ad3b6776 100644 (file)
@@ -2712,6 +2712,14 @@ win_close(win_T *win, int free_buf)
        // using the window.
        check_cursor();
     }
+
+    /*
+     * If last window has a status line now and we don't want one, remove the
+     * status line.  Do this before win_equal(), because it may change the
+     * height of a window
+     */
+    last_status(FALSE);
+
     if (p_ea && (*p_ead == 'b' || *p_ead == dir))
        // If the frame of the closed window contains the new current window,
        // only resize that frame.  Otherwise resize all windows.
@@ -2741,12 +2749,6 @@ win_close(win_T *win, int free_buf)
        --dont_parse_messages;
 #endif
 
-    /*
-     * If last window has a status line now and we don't want one,
-     * remove the status line.
-     */
-    last_status(FALSE);
-
     // After closing the help window, try restoring the window layout from
     // before it was opened.
     if (help_window)