diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-10-05 22:00:30 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-10-05 22:00:30 +0000 |
commit | fb6d4103628f27e5c21220e95c8eee0d732cef04 (patch) | |
tree | b01c3dfa2742107bb6fce4e6529e90becd9c227b /usr.bin/tmux | |
parent | da8e100ec771a4101204207679591445e7df14c9 (diff) |
screen_write_copy tried to be clever and clear the line if it reached
the end of the source, but it was wrong and causes problems that are
only showing up now we are more aggressive about skipping redundant
screen updates. Remove the optimization entirely as more trouble than it
is worth to fix (and it'll have to go when BCE is done anyway).
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/screen-write.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c index b604271e35e..538b0c0b88d 100644 --- a/usr.bin/tmux/screen-write.c +++ b/usr.bin/tmux/screen-write.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-write.c,v 1.95 2016/10/05 12:36:36 nicm Exp $ */ +/* $OpenBSD: screen-write.c,v 1.96 2016/10/05 22:00:29 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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); } |