aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2016-10-06 00:01:11 +0100
committerThomas Adam <thomas@xteddy.org>2016-10-06 00:01:11 +0100
commitfb0b2cd37ab990d859d43912e4da143f5373d496 (patch)
treedc72ab90e6ab8fa9fcf378af8d42ea8d695886be
parent5b8f033e06251ed13291becfedb305da46c36dc7 (diff)
parent30086e504c8a5389b96b72b81ac8dbefe19e0cf1 (diff)
downloadrtmux-fb0b2cd37ab990d859d43912e4da143f5373d496.tar.gz
rtmux-fb0b2cd37ab990d859d43912e4da143f5373d496.tar.bz2
rtmux-fb0b2cd37ab990d859d43912e4da143f5373d496.zip
Merge branch 'obsd-master'
-rw-r--r--screen-write.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/screen-write.c b/screen-write.c
index 39775174..3a1fc8c8 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -394,38 +394,18 @@ screen_write_copy(struct screen_write_ctx *ctx, struct screen *src, u_int px,
{
struct screen *s = ctx->s;
struct grid *gd = src->grid;
- struct grid_line *gl;
struct grid_cell gc;
- u_int xx, yy, cx, cy, ax, bx;
+ u_int xx, yy, cx, cy;
cx = s->cx;
cy = s->cy;
+
for (yy = py; yy < py + ny; yy++) {
- gl = &gd->linedata[yy];
- if (yy < gd->hsize + gd->sy) {
- /*
- * Find start and end position and copy between
- * them. Limit to the real end of the line then use a
- * clear EOL only if copying to the end, otherwise
- * could overwrite whatever is there already.
- */
- if (px > gl->cellsize)
- ax = gl->cellsize;
- else
- ax = px;
- if (px + nx == gd->sx && px + nx > gl->cellsize)
- bx = gl->cellsize;
- else
- bx = px + nx;
-
- for (xx = ax; xx < bx; xx++) {
- grid_get_cell(gd, xx, yy, &gc);
- screen_write_cell(ctx, &gc);
- }
- if (px + nx == gd->sx && px + nx > gl->cellsize)
- screen_write_clearendofline(ctx);
- } else
- screen_write_clearline(ctx);
+ for (xx = px; xx < px + nx; xx++) {
+ grid_get_cell(gd, xx, yy, &gc);
+ screen_write_cell(ctx, &gc);
+ }
+
cy++;
screen_write_cursormove(ctx, cx, cy);
}