summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-10-11 11:26:59 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-10-11 11:26:59 +0000
commita1f9ffd9dd4c6f07e66efc240f0147701f6387df (patch)
tree45a1355ea950029e9042e9163cad45639f5f95fb /usr.bin
parentffcc3b68966ec1ccab6265f72f38d11742866e0e (diff)
Clear to end of line properly with UTF-8 present.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/mode-tree.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/tmux/mode-tree.c b/usr.bin/tmux/mode-tree.c
index 1bdbb0d2406..73ab8d0c55a 100644
--- a/usr.bin/tmux/mode-tree.c
+++ b/usr.bin/tmux/mode-tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mode-tree.c,v 1.12 2017/10/11 08:08:16 nicm Exp $ */
+/* $OpenBSD: mode-tree.c,v 1.13 2017/10/11 11:26:58 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -554,10 +554,12 @@ mode_tree_draw(struct mode_tree_data *mtd)
}
if (i != mtd->current) {
- screen_write_puts(&ctx, &gc0, "%.*s", w, text);
+ screen_write_nputs(&ctx, w, &gc0, "%s", text);
screen_write_clearendofline(&ctx, 8);
- } else
- screen_write_puts(&ctx, &gc, "%-*.*s", w, w, text);
+ } else {
+ screen_write_nputs(&ctx, w, &gc, "%s", text);
+ screen_write_clearendofline(&ctx, gc.bg);
+ }
free(text);
if (mti->tagged) {