mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-16 05:34:00 -04:00
main: make sure cursor is inside the new row/col limits on resize
This commit is contained in:
parent
d5158b2432
commit
dfaa5f5640
1 changed files with 5 additions and 0 deletions
5
main.c
5
main.c
|
|
@ -546,6 +546,11 @@ resize(struct context *c, int width, int height)
|
||||||
if (c->term.scroll_region.end == old_rows)
|
if (c->term.scroll_region.end == old_rows)
|
||||||
c->term.scroll_region.end = c->term.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);
|
term_damage_all(&c->term);
|
||||||
|
|
||||||
if (!c->frame_is_scheduled)
|
if (!c->frame_is_scheduled)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue