nano

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

commit 91fff2a2c8756f842cfafa3138ea0af45522e0af
parent d6f43bd156cff0d9b8fa6bbdbe20a01408174ad5
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sun,  5 Jun 2016 21:18:32 +0200

screen: avoid looking up the width of whitespace and control codes

Spaces and tabs and control codes never are multi-column glyphs, so
only look up the width for "normal", visible characters.

Diffstat:
Msrc/winio.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -1787,9 +1787,6 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool } while (*buf != '\0') { - if (mbwidth(buf) > 1) - seen_wide = TRUE; - if (*buf == ' ') { /* Show a space as a visible character, or as a space. */ #ifndef NANO_TINY @@ -1837,6 +1834,9 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool start_col += mbwidth(character); free(character); + + if (mbwidth(buf) > 1) + seen_wide = TRUE; } buf += parse_mbchar(buf, NULL, NULL);