aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-06 06:59:48 +0800
committerGitHub <noreply@github.com>2023-06-06 06:59:48 +0800
commit30e9ddfd05f5f2fa56d7fd5235a3f993b94f9910 (patch)
tree55224edd080076a2ed5410fe7c24eeee1be87509 /src
parentc1ee187f82141d778335955c9603c69e6f4785d7 (diff)
parentfc908b500683215085ee6c12b41aa227332b7bbe (diff)
downloadrneovim-30e9ddfd05f5f2fa56d7fd5235a3f993b94f9910.tar.gz
rneovim-30e9ddfd05f5f2fa56d7fd5235a3f993b94f9910.tar.bz2
rneovim-30e9ddfd05f5f2fa56d7fd5235a3f993b94f9910.zip
Merge pull request #23927 from zeertzjq/vim-9.0.1603
vim-patch:9.0.{1603,1610}: display wrong if scrolling multiple lines with 'smoothscroll'
Diffstat (limited to 'src')
-rw-r--r--src/nvim/move.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 6fb6656472..5934ad90e9 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -1344,7 +1344,7 @@ bool scrollup(long line_count, int byfold)
int width1 = curwin->w_width_inner - curwin_col_off();
int width2 = width1 + curwin_col_off2();
unsigned size = 0;
- linenr_T prev_topline = curwin->w_topline;
+ const colnr_T prev_skipcol = curwin->w_skipcol;
if (do_sms) {
size = linetabsize(curwin, curwin->w_topline);
@@ -1396,8 +1396,9 @@ bool scrollup(long line_count, int byfold)
}
}
- if (curwin->w_topline == prev_topline) {
- // need to redraw even though w_topline didn't change
+ 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(curwin, UPD_NOT_VALID);
}
} else {