summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-07-16 17:02:25 +0100
committerThomas Adam <thomas@xteddy.org>2019-07-16 17:02:25 +0100
commit8e33cc61b107cce25db56c03061a2f49dbe32758 (patch)
tree2e0216ba9f4953142b6ad529fb01affedf23e5d6
parentb749a39cdb4bc4ff000f1ebeb253c7a245f16bb6 (diff)
parent99852f8401477e90e0887f1f2964fe6bdca86a57 (diff)
Merge branch 'obsd-master'
-rw-r--r--tty.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tty.c b/tty.c
index c3e2f0f6..ab1da9fd 100644
--- a/tty.c
+++ b/tty.c
@@ -1217,7 +1217,7 @@ tty_draw_line(struct tty *tty, struct window_pane *wp, struct screen *s,
const struct grid_cell *gcp;
struct grid_line *gl;
u_int i, j, ux, sx, width;
- int flags, cleared = 0;
+ int flags, cleared = 0, wrapped = 0;
char buf[512];
size_t len;
u_int cellsize;
@@ -1274,8 +1274,10 @@ tty_draw_line(struct tty *tty, struct window_pane *wp, struct screen *s,
tty_putcode(tty, TTYC_EL1);
cleared = 1;
}
- } else
+ } else {
log_debug("%s: wrapped line %u", __func__, aty);
+ wrapped = 1;
+ }
memcpy(&last, &grid_default_cell, sizeof last);
len = 0;
@@ -1299,13 +1301,15 @@ tty_draw_line(struct tty *tty, struct window_pane *wp, struct screen *s,
tty_clear_line(tty, wp, aty, atx + ux, width,
last.bg);
} else {
- tty_cursor(tty, atx + ux, aty);
+ if (!wrapped || atx != 0 || ux != 0)
+ tty_cursor(tty, atx + ux, aty);
tty_putn(tty, buf, len, width);
}
ux += width;
len = 0;
width = 0;
+ wrapped = 0;
}
if (gcp->flags & GRID_FLAG_SELECTED)
@@ -1339,7 +1343,8 @@ tty_draw_line(struct tty *tty, struct window_pane *wp, struct screen *s,
log_debug("%s: %zu cleared (end)", __func__, len);
tty_clear_line(tty, wp, aty, atx + ux, width, last.bg);
} else {
- tty_cursor(tty, atx + ux, aty);
+ if (!wrapped || atx != 0 || ux != 0)
+ tty_cursor(tty, atx + ux, aty);
tty_putn(tty, buf, len, width);
}
ux += width;