grid: resize: assert grid->cur_row is not NULL after a grid resize

This commit is contained in:
Daniel Eklöf 2022-10-09 16:12:18 +02:00
parent d4b0b0887e
commit 18ef36523f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

4
grid.c
View file

@ -485,6 +485,8 @@ grid_resize_without_reflow(
grid->saved_cursor.point = saved_cursor;
grid->cur_row = new_grid[(grid->offset + cursor.row) & (new_rows - 1)];
xassert(grid->cur_row != NULL);
grid->cursor.lcf = false;
grid->saved_cursor.lcf = false;
@ -1047,6 +1049,8 @@ grid_resize_and_reflow(
saved_cursor.col = min(saved_cursor.col, new_cols - 1);
grid->cur_row = new_grid[(grid->offset + cursor.row) & (new_rows - 1)];
xassert(grid->cur_row != NULL);
grid->cursor.point = cursor;
grid->saved_cursor.point = saved_cursor;