Blame tmux-2.6-fix-line-clear-utf8.patch

Andreas Schneider 0cd513
From 6e5121be7e280914f1116189b04c9c7a4b5f1590 Mon Sep 17 00:00:00 2001
Andreas Schneider 0cd513
From: nicm <nicm>
Andreas Schneider 0cd513
Date: Wed, 11 Oct 2017 11:26:58 +0000
Andreas Schneider 0cd513
Subject: [PATCH] Clear to end of line properly with UTF-8 present.
Andreas Schneider 0cd513
Andreas Schneider 0cd513
---
Andreas Schneider 0cd513
 mode-tree.c | 8 +++++---
Andreas Schneider 0cd513
 1 file changed, 5 insertions(+), 3 deletions(-)
Andreas Schneider 0cd513
Andreas Schneider 0cd513
diff --git a/mode-tree.c b/mode-tree.c
Andreas Schneider 0cd513
index 7b3787950..349cda493 100644
Andreas Schneider 0cd513
--- a/mode-tree.c
Andreas Schneider 0cd513
+++ b/mode-tree.c
Andreas Schneider 0cd513
@@ -554,10 +554,12 @@ mode_tree_draw(struct mode_tree_data *mtd)
Andreas Schneider 0cd513
 		}
Andreas Schneider 0cd513
 
Andreas Schneider 0cd513
 		if (i != mtd->current) {
Andreas Schneider 0cd513
-			screen_write_puts(&ctx, &gc0, "%.*s", w, text);
Andreas Schneider 0cd513
+			screen_write_nputs(&ctx, w, &gc0, "%s", text);
Andreas Schneider 0cd513
 			screen_write_clearendofline(&ctx, 8);
Andreas Schneider 0cd513
-		} else
Andreas Schneider 0cd513
-			screen_write_puts(&ctx, &gc, "%-*.*s", w, w, text);
Andreas Schneider 0cd513
+		} else {
Andreas Schneider 0cd513
+			screen_write_nputs(&ctx, w, &gc, "%s", text);
Andreas Schneider 0cd513
+			screen_write_clearendofline(&ctx, gc.bg);
Andreas Schneider 0cd513
+		}
Andreas Schneider 0cd513
 		free(text);
Andreas Schneider 0cd513
 
Andreas Schneider 0cd513
 		if (mti->tagged) {