multigrid: avoid allocation when not ext_multigrid.

Move grid specific functions from mbyte.c to screen.c
This commit is contained in:
Björn Linse
2018-08-25 13:23:54 +02:00
parent 4f1dcf7c28
commit 1a896bc93f
5 changed files with 172 additions and 140 deletions

View File

@@ -3990,7 +3990,7 @@ void win_free_grid(win_T *wp, bool reinit)
ui_call_grid_destroy(wp->w_grid.handle);
wp->w_grid.handle = 0;
}
free_screengrid(&wp->w_grid);
grid_free(&wp->w_grid);
if (reinit) {
// if a float is turned into a split and back into a float, the grid
// data structure will be reused
@@ -4100,7 +4100,7 @@ void win_alloc_lines(win_T *wp)
{
wp->w_lines_valid = 0;
assert(wp->w_grid.Rows >= 0);
wp->w_lines = xcalloc(wp->w_grid.Rows + 1, sizeof(wline_T));
wp->w_lines = xcalloc(MAX(wp->w_grid.Rows + 1, Rows), sizeof(wline_T));
}
/*