mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-17 02:41:07 +01:00
Don't let cursor position overflow when reflowing, from Christopher
Collins.
This commit is contained in:
parent
25c430b1cd
commit
88a4da9747
8
screen.c
8
screen.c
@ -365,7 +365,13 @@ void
|
||||
screen_reflow(struct screen *s, u_int new_x)
|
||||
{
|
||||
struct grid *old = s->grid;
|
||||
u_int change;
|
||||
|
||||
s->grid = grid_create(old->sx, old->sy, old->hlimit);
|
||||
s->cy -= grid_reflow(s->grid, old, new_x);
|
||||
|
||||
change = grid_reflow(s->grid, old, new_x);
|
||||
if (change < s->cy)
|
||||
s->cy -= change;
|
||||
else
|
||||
s->cy = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user