summaryrefslogtreecommitdiff
path: root/src/move.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-03 18:35:07 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-03 18:35:07 +0000
commitb21b8e9ed081a6ef6b6745fe65d219b3ac046c3b (patch)
tree9f72821277ed5f65df1c6ed76473d714fb4aa197 /src/move.c
parentc0370529c027abc5b1698d53fcfb8c02a0c515da (diff)
downloadvim-git-b21b8e9ed081a6ef6b6745fe65d219b3ac046c3b.tar.gz
patch 9.0.1000: with 'smoothscroll' skipcol may be reset unnecessarilyv9.0.1000
Problem: With 'smoothscroll' skipcol may be reset unnecessarily. Solution: Check the line does actually fit in the window.
Diffstat (limited to 'src/move.c')
-rw-r--r--src/move.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/move.c b/src/move.c
index d976697ec..7a9ae3ea6 100644
--- a/src/move.c
+++ b/src/move.c
@@ -1909,7 +1909,11 @@ adjust_skipcol(void)
int scrolled = FALSE;
validate_cheight();
- if (curwin->w_cline_height == curwin->w_height)
+ if (curwin->w_cline_height == curwin->w_height
+ // w_cline_height may be capped at w_height, check there aren't
+ // actually more lines.
+ && plines_win(curwin, curwin->w_cursor.lnum, FALSE)
+ <= curwin->w_height)
{
// the line just fits in the window, don't scroll
reset_skipcol();