aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-06 06:26:13 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-06-06 06:37:23 +0800
commit9978a9996dae9b62763db6772e7f1f777caacb45 (patch)
tree417293aef035b9ab312fd2d91d3c642930af7ba6 /src/nvim/move.c
parentc1ee187f82141d778335955c9603c69e6f4785d7 (diff)
downloadrneovim-9978a9996dae9b62763db6772e7f1f777caacb45.tar.gz
rneovim-9978a9996dae9b62763db6772e7f1f777caacb45.tar.bz2
rneovim-9978a9996dae9b62763db6772e7f1f777caacb45.zip
vim-patch:9.0.1603: display wrong if scrolling multiple lines with 'smoothscroll'
Problem: Display wrong when scrolling multiple lines with 'smoothscroll' set. Solution: Redraw when w_skipcol changed. (closes vim/vim#12477, closes vim/vim#12468) https://github.com/vim/vim/commit/3c802277604a6b21110e41bedfe4c937ba7c2b7d
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r--src/nvim/move.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 6fb6656472..5d817fd7aa 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -1345,6 +1345,7 @@ bool scrollup(long line_count, int byfold)
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 +1397,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 (curwin->w_topline == prev_topline
+ || curwin->w_skipcol != prev_skipcol) {
+ // need to redraw because wl_size of the topline may now be invalid
redraw_later(curwin, UPD_NOT_VALID);
}
} else {