From: Luuk van Baal Date: Wed, 14 Sep 2022 00:27:23 +0000 (+0100) Subject: patch 9.0.0461: 'scroll' is not always updated X-Git-Tag: v9.0.0461 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=470a14140bc06f1653edf26ab0b3c9b801080353;p=vim patch 9.0.0461: 'scroll' is not always updated Problem: 'scroll' is not always updated. Solution: Call win_init_size() at the right place. --- diff --git a/src/main.c b/src/main.c index 619302aa2..6875ee5d3 100644 --- a/src/main.c +++ b/src/main.c @@ -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 /* diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index 10cf27da0..c9f9caa34 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -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")) diff --git a/src/version.c b/src/version.c index ab132ca0c..62a43a708 100644 --- a/src/version.c +++ b/src/version.c @@ -703,6 +703,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 461, /**/ 460, /**/ diff --git a/src/window.c b/src/window.c index 49f57b56b..6fefcac75 100644 --- a/src/window.c +++ b/src/window.c @@ -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; }