main: make sure cursor is inside the new row/col limits on resize

This commit is contained in:
Daniel Eklöf 2019-07-02 22:32:25 +02:00
parent d5158b2432
commit dfaa5f5640
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

5
main.c
View file

@ -546,6 +546,11 @@ resize(struct context *c, int width, int height)
if (c->term.scroll_region.end == old_rows)
c->term.scroll_region.end = c->term.rows;
term_cursor_to(
&c->term,
min(c->term.cursor.row, c->term.rows),
min(c->term.cursor.col, c->term.cols));
term_damage_all(&c->term);
if (!c->frame_is_scheduled)