From bf244b038b727daea658caa6ef403eb2f0fb0e3e Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 27 Jul 2014 21:52:16 +0000 Subject: Even for UTF-8 output, a non-breaking space character has the same width as a normal space character, and not width 0. Bug reported by bentley@. --- term_ascii.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'term_ascii.c') diff --git a/term_ascii.c b/term_ascii.c index b7712dc4..abc70f03 100644 --- a/term_ascii.c +++ b/term_ascii.c @@ -269,7 +269,12 @@ locale_width(const struct termp *p, int c) { int rc; - return((rc = wcwidth(c)) < 0 ? 0 : rc); + if (c == ASCII_NBRSP) + c = ' '; + rc = wcwidth(c); + if (rc < 0) + rc = 0; + return(rc); } static void -- cgit