Don't let cursor position overflow when reflowing, from Christopher

Collins.
pull/1/head
Nicholas Marriott 2013-05-15 15:39:51 +00:00
parent 25c430b1cd
commit 88a4da9747
1 changed files with 7 additions and 1 deletions

View File

@ -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;
}