render: resize: only stay on current row if col is within grid width

This commit is contained in:
Daniel Eklöf 2020-02-12 19:49:39 +01:00
parent 69a633221f
commit c28c0ab9c2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1227,6 +1227,8 @@ maybe_resize(struct terminal *term, int width, int height, bool force)
while (cursor_row < 0) while (cursor_row < 0)
cursor_row += term->grid->num_rows; cursor_row += term->grid->num_rows;
if (term->cursor.point.col < term->cols - 1)
cursor_row--; cursor_row--;
assert(cursor_row < term->rows); assert(cursor_row < term->rows);