Skip to content

Commit 5c60684

Browse files
luukvbaalbrammool
authored andcommitted
patch 9.0.1608: update_topline() is called twice
Problem: update_topline() is called twice. Solution: Do not call update_topline() before curs_columns(). (Luuk van Baal, closes #12495)
1 parent 55daae3 commit 5c60684

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/version.c

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

696696
static int included_patches[] =
697697
{ /* Add new patch number below this line */
698+
/**/
699+
1608,
698700
/**/
699701
1607,
700702
/**/

src/window.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7032,11 +7032,8 @@ scroll_to_fraction(win_T *wp, int prev_height)
70327032
}
70337033

70347034
if (wp == curwin)
7035-
{
7036-
if (get_scrolloff_value())
7037-
update_topline();
70387035
curs_columns(FALSE); // validate w_wrow
7039-
}
7036+
70407037
if (prev_height > 0)
70417038
wp->w_prev_fraction_row = wp->w_wrow;
70427039

@@ -7055,13 +7052,10 @@ win_new_width(win_T *wp, int width)
70557052
wp->w_lines_valid = 0;
70567053
changed_line_abv_curs_win(wp);
70577054
invalidate_botline_win(wp);
7058-
if (wp == curwin)
7059-
{
7060-
skip_update_topline = (*p_spk != 'c');
7061-
update_topline();
7055+
7056+
if (wp == curwin && *p_spk == 'c')
70627057
curs_columns(TRUE); // validate w_wrow
7063-
skip_update_topline = FALSE;
7064-
}
7058+
70657059
redraw_win_later(wp, UPD_NOT_VALID);
70667060
wp->w_redr_status = TRUE;
70677061
}

0 commit comments

Comments
 (0)