summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-08-06 03:29:16 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-08-06 03:29:16 +0000
commit7b2c898b2ecf3e6317d141006f92fec27710dc8b (patch)
treedcd6ff54666baea81dd2a9309919fc39cf732021 /usr.bin
parent1f2c28284a66cc8c2aa972b6e2f8fdeec6012f1a (diff)
Tweak previous not to replace complete characters with spaces.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/tty.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 58259f0d040..bd42793989a 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.395 2021/08/06 03:13:05 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.396 2021/08/06 03:29:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1348,8 +1348,8 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
const struct grid_cell *gcp;
struct grid_line *gl;
struct client *c = tty->client;
- u_int i, j, ux, sx, width;
- int flags, cleared = 0, wrapped = 0, hidden;
+ u_int i, j, ux, sx, width, hidden;
+ int flags, cleared = 0, wrapped = 0;
char buf[512];
size_t len;
u_int cellsize;
@@ -1452,12 +1452,13 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
hidden = 0;
for (j = 0; j < gcp->data.width; j++) {
- if (!tty_check_overlay(tty, atx + ux + j, aty)) {
- hidden = 1;
- break;
- }
+ if (!tty_check_overlay(tty, atx + ux + j, aty))
+ hidden++;
}
- if (hidden || ux + gcp->data.width > nx) {
+ if (hidden != 0 && hidden == gcp->data.width) {
+ if (~gcp->flags & GRID_FLAG_PADDING)
+ ux += gcp->data.width;
+ } else if (hidden != 0 || ux + gcp->data.width > nx) {
if (~gcp->flags & GRID_FLAG_PADDING) {
tty_attributes(tty, &last, defaults, palette);
tty_cursor(tty, atx + ux, aty);