Fix resize from width=1 to wider.

Test Plan:
Shrink terminal to width=1 and expand. Empty lines appear above
prompt line.

Reviewers: billiob

Differential Revision: https://phab.enlightenment.org/D361
This commit is contained in:
Aleksandar Popadić 2013-12-02 21:51:03 +01:00 committed by Boris Faure
parent da8c2ce773
commit b31638a630
1 changed files with 16 additions and 6 deletions

View File

@ -741,7 +741,6 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
int i;
if ((ty->w == new_w) && (ty->h == new_h)) return;
if ((new_w == new_h) && (new_w == 1)) return;
termpty_save_freeze();
@ -766,12 +765,23 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
new_back = calloc(sizeof(Termsave *), ty->backmax);
y_end = ty->state.cy;
y_start = termpty_line_find_top(ty, ty->state.cy);
new_y_start = new_h - 1 - (y_end - y_start);
new_y_end = new_y_start - 1;
y_start = termpty_line_find_top(ty, y_end);
if (ty->w == 1)
{
new_y_start = new_h - 1;
new_y_end = new_y_start - 1;
}
else
{
new_y_start = new_h - 1 - (y_end - y_start);
new_y_end = new_y_start - 1;
if (new_y_end < 0)
{
new_y_start = 0;
new_y_end = -1;
}
}
y_end = y_start - 1;
if (new_y_end < 0)
new_y_end = -1;
while ((y_end >= -ty->backscroll_num) && (new_y_end >= -ty->backmax))
{
y_start = termpty_line_find_top(ty, y_end);