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.
This commit is contained in:
Björn Linse
2019-02-07 13:05:25 +01:00
parent 6e9ea5adce
commit be8058cfe4
4 changed files with 17 additions and 35 deletions

View File

@@ -300,7 +300,7 @@ int main(int argc, char **argv)
assert(p_ch >= 0 && Rows >= p_ch && Rows - p_ch <= INT_MAX);
cmdline_row = (int)(Rows - p_ch);
msg_row = cmdline_row;
screenalloc(false); // allocate screen buffers
screenalloc(); // allocate screen buffers
set_init_2(headless_mode);
TIME_MSG("inits 2");