Mercurial > vim
diff src/move.c @ 32557:e64d1fd43178 v9.0.1610
patch 9.0.1610: display is wrong when 'smoothscroll' is set
Commit: https://github.com/vim/vim/commit/d9a92dc70b20c76cef9ca186676583c92c14311c
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon Jun 5 18:41:35 2023 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 05 Jun 2023 19:45:04 +0200 |
parents | 745f1e43106f |
children | f8eca24e58d6 |
line wrap: on
line diff
--- a/src/move.c +++ b/src/move.c @@ -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