From 4c6ce3c39d3c593dbf7e8d93e74176faff9979e9 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 7 Jan 2021 19:17:22 +0100 Subject: [PATCH] minibar: when the overnext character has zero width too, show its code Requested-by: Peter Passchier --- src/winio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/winio.c b/src/winio.c index 16201767..21955372 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2162,10 +2162,17 @@ void minibar(void) #ifdef ENABLE_UTF8 successor = this_position + char_length(this_position); - if (*this_position != '\0' && is_zerowidth(successor) && + if (*this_position && *successor && is_zerowidth(successor) && mbtowc(&widecode, successor, MAXCHARLEN) >= 0) { sprintf(hexadecimal, "|%04X", (int)widecode); waddstr(bottomwin, hexadecimal); + + successor += char_length(successor); + + if (is_zerowidth(successor) && mbtowc(&widecode, successor, MAXCHARLEN) >= 0) { + sprintf(hexadecimal, "|%04X", (int)widecode); + waddstr(bottomwin, hexadecimal); + } } else successor = NULL; #endif