Commit 91fff2a2 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
parent d6f43bd1
No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment