From be8058cfe4b7adff60a68d9503a01e322d7d2ff9 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 7 Feb 2019 13:05:25 +0100 Subject: screen: cleanup allocation, clearing and validation grid_xx functions shouldn't randomly be called when the screen is not valid. Nvim deterministically initializes a default screen early in main(), so the default grid can be assumed to be allocated. --- src/nvim/move.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/move.c') diff --git a/src/nvim/move.c b/src/nvim/move.c index 869b877b02..7aa7f922c1 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -152,7 +152,7 @@ void update_topline(void) // If there is no valid screen and when the window height is zero just use // the cursor line. - if (!screen_valid(true) || curwin->w_height_inner == 0) { + if (!default_grid.chars || curwin->w_height_inner == 0) { curwin->w_topline = curwin->w_cursor.lnum; curwin->w_botline = curwin->w_topline; curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; -- cgit