Blob Blame History Raw
From 6e5121be7e280914f1116189b04c9c7a4b5f1590 Mon Sep 17 00:00:00 2001
From: nicm <nicm>
Date: Wed, 11 Oct 2017 11:26:58 +0000
Subject: [PATCH] Clear to end of line properly with UTF-8 present.

---
 mode-tree.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mode-tree.c b/mode-tree.c
index 7b3787950..349cda493 100644
--- a/mode-tree.c
+++ b/mode-tree.c
@@ -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) {