1
0
forked from aniani/vim

patch 9.0.1610: display is wrong when 'smoothscroll' is set

Problem:    Display is wrong when 'smoothscroll' is set and scrolling multiple
            lines.
Solution:   Redraw with UPD_NOT_VALID when "skipcol" is or was set.
            (closes #12490, closes #12468)
This commit is contained in:
zeertzjq
2023-06-05 18:41:35 +01:00
committed by Bram Moolenaar
parent f7ca56f719
commit d9a92dc70b
6 changed files with 26 additions and 12 deletions

View File

@@ -1786,7 +1786,6 @@ scrollup(
int width1 = curwin->w_width - curwin_col_off();
int width2 = width1 + curwin_col_off2();
int size = 0;
linenr_T prev_topline = curwin->w_topline;
colnr_T prev_skipcol = curwin->w_skipcol;
if (do_sms)
@@ -1850,10 +1849,9 @@ scrollup(
}
}
// TODO: is comparing w_topline with prev_topline still needed?
if (curwin->w_topline == prev_topline
|| curwin->w_skipcol != prev_skipcol)
// need to redraw because wl_size of the topline may now be invalid
if (prev_skipcol > 0 || curwin->w_skipcol > 0)
// need to redraw more, because wl_size of the (new) topline may
// now be invalid
redraw_later(UPD_NOT_VALID);
}
else