]> granicus.if.org Git - vim/commitdiff
patch 9.0.0461: 'scroll' is not always updated v9.0.0461
authorLuuk van Baal <luukvbaal@gmail.com>
Wed, 14 Sep 2022 00:27:23 +0000 (01:27 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 14 Sep 2022 00:27:23 +0000 (01:27 +0100)
Problem:    'scroll' is not always updated.
Solution:   Call win_init_size() at the right place.

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

index 619302aa22cbdbaa865e5a63a911c0170755b2ba..6875ee5d38739529d4b009ad19975691c7087372 100644 (file)
@@ -375,6 +375,7 @@ main
      * Set the default values for the options that use Rows and Columns.
      */
     ui_get_shellsize();                // inits Rows and Columns
+    win_init_size();
 #ifdef FEAT_DIFF
     // Set the 'diff' option now, so that it can be checked for in a .vimrc
     // file.  There is no buffer yet though.
@@ -539,9 +540,9 @@ vim_main2(void)
        // don't have them.
        if (!gui.in_use && params.evim_mode)
            mch_exit(1);
+       firstwin->w_prev_height = firstwin->w_height; // may have changed
     }
 #endif
-    win_init_size();
 
 #ifdef FEAT_VIMINFO
     /*
index 10cf27da012863c86b20c0ba4862523d43d7f272..c9f9caa3472801092656d90056c740c71bde6ff6 100644 (file)
@@ -1668,6 +1668,7 @@ func Test_splitscroll_with_splits()
               execute 'norm gg' . pos
               split | redraw | wincmd k
               call assert_equal(1, line("w0"))
+              call assert_equal(&scroll, winheight(0) / 2)
               wincmd j
               call assert_equal(win_screenpos(0)[0] - tabline - winbar_sb, line("w0"))
 
index ab132ca0c19f3e290c98affa3aee9fb52cf002eb..62a43a70873cfc851c16f6c582dba7e87d1fead3 100644 (file)
@@ -703,6 +703,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    461,
 /**/
     460,
 /**/
index 49f57b56be630d9a9047818e0204f8b852b43391..6fefcac7507bdebf179aff00cb70762af1541b8c 100644 (file)
@@ -6384,6 +6384,7 @@ win_fix_scroll(int resize)
            invalidate_botline_win(wp);
            validate_botline_win(wp);
        }
+       win_comp_scroll(wp);
        wp->w_prev_height = wp->w_height;
        wp->w_prev_winrow = wp->w_winrow;
     }