termpty: fix resizing

do not add a useless newline
do not copy the same content few times
This commit is contained in:
Boris Faure 2015-09-13 23:15:07 +02:00
parent 386cf11b19
commit a334bf6554
1 changed files with 2 additions and 1 deletions

View File

@ -947,6 +947,7 @@ _termpty_line_rewrap(Termpty *ty, Termcell *cells, int len,
} }
len -= copy_width; len -= copy_width;
si->x += copy_width; si->x += copy_width;
cells += copy_width;
if (si->x >= si->w) if (si->x >= si->w)
{ {
si->y++; si->y++;
@ -954,7 +955,7 @@ _termpty_line_rewrap(Termpty *ty, Termcell *cells, int len,
} }
_check_screen_info(ty, si); _check_screen_info(ty, si);
} }
if (!autowrapped) if (!autowrapped && si->x != 0)
{ {
si->y++; si->y++;
si->x = 0; si->x = 0;