summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-09-13 23:15:07 +0200
committerBoris Faure <billiob@gmail.com>2015-09-16 19:20:54 +0200
commita31782c720fc35e2fb5aeab738e5a2d7de2b52a2 (patch)
tree3afaa4814aa0ef4a404158bdde25493ee07620d8
parent8fed6980362c44744596aae6dd9ea8beaf65271f (diff)
termpty: fix resizing
do not add a useless newline do not copy the same content few times
-rw-r--r--src/bin/termpty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 73c76e9..ef1bc87 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -947,6 +947,7 @@ _termpty_line_rewrap(Termpty *ty, Termcell *cells, int len,
947 } 947 }
948 len -= copy_width; 948 len -= copy_width;
949 si->x += copy_width; 949 si->x += copy_width;
950 cells += copy_width;
950 if (si->x >= si->w) 951 if (si->x >= si->w)
951 { 952 {
952 si->y++; 953 si->y++;
@@ -954,7 +955,7 @@ _termpty_line_rewrap(Termpty *ty, Termcell *cells, int len,
954 } 955 }
955 _check_screen_info(ty, si); 956 _check_screen_info(ty, si);
956 } 957 }
957 if (!autowrapped) 958 if (!autowrapped && si->x != 0)
958 { 959 {
959 si->y++; 960 si->y++;
960 si->x = 0; 961 si->x = 0;