Skip to content

Commit 470a141

Browse files
luukvbaalbrammool
authored andcommitted
patch 9.0.0461: 'scroll' is not always updated
Problem: 'scroll' is not always updated. Solution: Call win_init_size() at the right place.
1 parent 766ae5b commit 470a141

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ main
375375
* Set the default values for the options that use Rows and Columns.
376376
*/
377377
ui_get_shellsize(); // inits Rows and Columns
378+
win_init_size();
378379
#ifdef FEAT_DIFF
379380
// Set the 'diff' option now, so that it can be checked for in a .vimrc
380381
// file. There is no buffer yet though.
@@ -539,9 +540,9 @@ vim_main2(void)
539540
// don't have them.
540541
if (!gui.in_use && params.evim_mode)
541542
mch_exit(1);
543+
firstwin->w_prev_height = firstwin->w_height; // may have changed
542544
}
543545
#endif
544-
win_init_size();
545546

546547
#ifdef FEAT_VIMINFO
547548
/*

src/testdir/test_window_cmd.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,6 +1668,7 @@ func Test_splitscroll_with_splits()
16681668
execute 'norm gg' . pos
16691669
split | redraw | wincmd k
16701670
call assert_equal(1, line("w0"))
1671+
call assert_equal(&scroll, winheight(0) / 2)
16711672
wincmd j
16721673
call assert_equal(win_screenpos(0)[0] - tabline - winbar_sb, line("w0"))
16731674

src/version.c

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

704704
static int included_patches[] =
705705
{ /* Add new patch number below this line */
706+
/**/
707+
461,
706708
/**/
707709
460,
708710
/**/

src/window.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6384,6 +6384,7 @@ win_fix_scroll(int resize)
63846384
invalidate_botline_win(wp);
63856385
validate_botline_win(wp);
63866386
}
6387+
win_comp_scroll(wp);
63876388
wp->w_prev_height = wp->w_height;
63886389
wp->w_prev_winrow = wp->w_winrow;
63896390
}

0 commit comments

Comments
 (0)