From 2fefb5e7d343f21cfc64f299b032a679fbd27ef9 Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Tue, 23 Dec 2014 12:14:01 +0100 Subject: vim-patch:7.4.458 Problem: Issue 252: Cursor moves in a zero-height window. Solution: Check for zero height. (idea by Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-458 --- src/nvim/move.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/nvim/move.c') 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; -- cgit