summaryrefslogtreecommitdiff
path: root/src/move.c
diff options
context:
space:
mode:
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();