aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r--src/nvim/move.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 95b961e52c..40f301e595 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -146,6 +146,15 @@ void update_topline(void)
if (!screen_valid(TRUE))
return;
+ // If the window height is zero, just use the cursor line.
+ if (curwin->w_height == 0) {
+ curwin->w_topline = curwin->w_cursor.lnum;
+ curwin->w_botline = curwin->w_topline;
+ curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
+ curwin->w_scbind_pos = 1;
+ return;
+ }
+
check_cursor_moved(curwin);
if (curwin->w_valid & VALID_TOPLINE)
return;