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
.
master
parent
6470106eef
commit
edc0d6280a
|
@ -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 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);
|
index = move_mbleft(converted, index);
|
||||||
|
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
|
|
Loading…
Reference in New Issue