From 47f3dc75d8093fedee0a1150948902de8ec8d30c Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 15 Mar 2019 14:43:15 +0100 Subject: [PATCH] display: use non-breaking space instead of dot for VTE-bug workaround When UTF-8 is available, it is better to use a character that displays as a space. This improves the fix for https://savannah.gnu.org/bugs/?55896. --- src/winio.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/winio.c b/src/winio.c index 4b3b82a3..4589164b 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2696,8 +2696,16 @@ void edit_draw(filestruct *fileptr, const char *converted, if (*(converted + target_x) != '\0') { charlen = parse_mbchar(converted + target_x, striped_char, NULL); target_column = strnlenpt(converted, target_x); + } else if (target_column + 1 == editwincols) { + /* Defeat a VTE bug -- see https://sv.gnu.org/bugs/?55896. */ + if (using_utf8()) { + striped_char[0] = '\xC2'; + striped_char[1] = '\xA0'; + charlen = 2; + } else + striped_char[0] = '.'; } else - striped_char[0] = (target_column + 1 == editwincols) ? '.' : ' '; + striped_char[0] = ' '; wattron(edit, interface_color_pair[GUIDE_STRIPE]); mvwaddnstr(edit, row, margin + target_column, striped_char, charlen);