nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 4c6ce3c39d3c593dbf7e8d93e74176faff9979e9
parent 41fd09706d734776f1b1f6bead8d58808ec71685
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu,  7 Jan 2021 19:17:22 +0100

minibar: when the overnext character has zero width too, show its code

Requested-by: Peter Passchier <peter@passchier.net>

Diffstat:
Msrc/winio.c | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 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