commit edc0d6280acd7f6969d63d48c993cfe608b8e57d
parent 6470106eefd6e91d55afe6e82029b98ce5faa2d3
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 5 Feb 2019 14:53:08 -0600
display: properly trim double-width characters at the edit window's edge
When a line ends with a two-column character, and this character straddles
the edit window's edge, then, although we've reached the end of 'buf', we
have exceeded the 'beyond' column and this two-column character needs to
be trimmed from the 'converted' string, otherwise it would get printed on
the next row.
This fixes https://savannah.gnu.org/bugs/?55638.
Bug existed since version 2.8.0, commit 5283acdc.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/winio.c b/src/winio.c
@@ -1988,7 +1988,7 @@ char *display_string(const char *buf, size_t column, size_t span, bool isdata)
}
/* If there is more text than can be shown, make room for the $ or >. */
- if (*buf != '\0' && (column > beyond || (isdata && !ISSET(SOFTWRAP)))) {
+ if ((*buf != '\0' || column > beyond) && isdata && !ISSET(SOFTWRAP)) {
index = move_mbleft(converted, index);
#ifdef ENABLE_UTF8