forked from enlightenment/terminology
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:
parent
da8c2ce773
commit
b31638a630
|
@ -741,7 +741,6 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((ty->w == new_w) && (ty->h == new_h)) return;
|
if ((ty->w == new_w) && (ty->h == new_h)) return;
|
||||||
if ((new_w == new_h) && (new_w == 1)) return;
|
|
||||||
|
|
||||||
termpty_save_freeze();
|
termpty_save_freeze();
|
||||||
|
|
||||||
|
@ -766,12 +765,23 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
|
||||||
new_back = calloc(sizeof(Termsave *), ty->backmax);
|
new_back = calloc(sizeof(Termsave *), ty->backmax);
|
||||||
|
|
||||||
y_end = ty->state.cy;
|
y_end = ty->state.cy;
|
||||||
y_start = termpty_line_find_top(ty, ty->state.cy);
|
y_start = termpty_line_find_top(ty, y_end);
|
||||||
new_y_start = new_h - 1 - (y_end - y_start);
|
if (ty->w == 1)
|
||||||
new_y_end = new_y_start - 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;
|
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))
|
while ((y_end >= -ty->backscroll_num) && (new_y_end >= -ty->backmax))
|
||||||
{
|
{
|
||||||
y_start = termpty_line_find_top(ty, y_end);
|
y_start = termpty_line_find_top(ty, y_end);
|
||||||
|
|
Loading…
Reference in New Issue