render: resize: calculated cursor row *should* never be beyond the screen bottom

This commit is contained in:
Daniel Eklöf 2020-02-10 22:40:16 +01:00
parent 88e2ab21b3
commit e56523f326
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1229,9 +1229,10 @@ maybe_resize(struct terminal *term, int width, int height, bool force)
cursor_row += term->grid->num_rows;
cursor_row--;
assert(cursor_row < term->rows);
term_cursor_to(
term,
min(max(cursor_row, 0), term->rows - 1),
max(cursor_row, 0),
min(term->cursor.point.col, term->cols - 1));
term->render.last_cursor.cell = NULL;