summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-01-22 11:28:34 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-01-22 11:28:34 +0000
commit9301b85cfd06d80735f4beb29839a2463bb69fd1 (patch)
treec7d2ee93eb382a1e5b35b35f68b045521139a4bc /usr.bin
parent32460b2f63116f769c6b7cdf5ee19921184e8f50 (diff)
Revert clear changes to writing as they don't work properly, better
change to come.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/screen-write.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index 3339d6b08ca..917fbaeb3e5 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.190 2021/01/18 10:27:54 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.191 2021/01/22 11:28:33 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1516,7 +1516,6 @@ screen_write_collect_flush(struct screen_write_ctx *ctx, int scroll_only,
struct screen_write_collect_item *ci, *tmp;
struct screen_write_collect_line *cl;
u_int y, cx, cy, items = 0;
- int clear = 0;
struct tty_ctx ttyctx;
size_t written = 0;
@@ -1540,29 +1539,22 @@ screen_write_collect_flush(struct screen_write_ctx *ctx, int scroll_only,
cx = s->cx; cy = s->cy;
for (y = 0; y < screen_size_y(s); y++) {
cl = &ctx->s->write_list[y];
+ if (cl->bg != 0) {
+ screen_write_set_cursor(ctx, 0, y);
+ screen_write_initctx(ctx, &ttyctx, 1);
+ ttyctx.bg = cl->bg - 1;
+ tty_write(tty_cmd_clearline, &ttyctx);
+ }
TAILQ_FOREACH_SAFE(ci, &cl->items, entry, tmp) {
- if (clear != -1 &&
- (u_int)clear != ci->x &&
- cl->bg != 0) {
- screen_write_set_cursor(ctx, clear, y);
- screen_write_initctx(ctx, &ttyctx, 1);
- ttyctx.bg = cl->bg - 1;
- ttyctx.num = ci->x - clear;
- log_debug("clear %u at %u", ttyctx.num, clear);
- tty_write(tty_cmd_clearcharacter, &ttyctx);
- }
-
screen_write_set_cursor(ctx, ci->x, y);
if (ci->type == CLEAR_END) {
screen_write_initctx(ctx, &ttyctx, 1);
ttyctx.bg = ci->bg;
tty_write(tty_cmd_clearendofline, &ttyctx);
- clear = -1;
} else if (ci->type == CLEAR_START) {
screen_write_initctx(ctx, &ttyctx, 1);
ttyctx.bg = ci->bg;
tty_write(tty_cmd_clearstartofline, &ttyctx);
- clear = ci->x + 1;
} else {
screen_write_initctx(ctx, &ttyctx, 0);
ttyctx.cell = &ci->gc;
@@ -1570,7 +1562,6 @@ screen_write_collect_flush(struct screen_write_ctx *ctx, int scroll_only,
ttyctx.ptr = cl->data + ci->x;
ttyctx.num = ci->used;
tty_write(tty_cmd_cells, &ttyctx);
- clear = ci->x + ci->used;
}
items++;
@@ -1579,16 +1570,6 @@ screen_write_collect_flush(struct screen_write_ctx *ctx, int scroll_only,
TAILQ_REMOVE(&cl->items, ci, entry);
free(ci);
}
- if (clear != -1 &&
- (u_int)clear != screen_size_x(s) - 1 &&
- cl->bg != 0) {
- screen_write_set_cursor(ctx, clear, y);
- screen_write_initctx(ctx, &ttyctx, 1);
- ttyctx.bg = cl->bg - 1;
- log_debug("clear to end at %u", clear);
- tty_write(tty_cmd_clearendofline, &ttyctx);
- }
- clear = 0;
cl->bg = 0;
}
s->cx = cx; s->cy = cy;