nano

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

commit 7c30d1fa699fd4acafb0e543b5b5d3ca783acaa5
parent 031166c34ddedd035780fd5b689b550e15d2cd01
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 22 Feb 2019 14:09:17 +0100

display: account for zero-width characters when reserving space for '>'

That is: keep nibbling off characters until a character is eaten that
takes up at least one column.

This fixes https://savannah.gnu.org/bugs/?55759.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>

Bug existed since version 2.8.0, commit 5283acdc.

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

diff --git a/src/winio.c b/src/winio.c @@ -1990,7 +1990,9 @@ 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 ">". */ if ((*buf != '\0' || column > beyond) && (currmenu != MMAIN || (isdata && !ISSET(SOFTWRAP)))) { - index = move_mbleft(converted, index); + do { + index = move_mbleft(converted, index); + } while (mbwidth(converted + index) == 0); #ifdef ENABLE_UTF8 /* Display the left half of a two-column character as '['. */