From 3ce74eb8fec62abb7cbdb49656401ba30473a2eb Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 21 Apr 2019 11:35:25 +0200 Subject: [PATCH] wrapping: compute the width of a succeeding line in the correct manner Its number of columns needs to be computed, not its number of bytes. --- src/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text.c b/src/text.c index 09a33c62..1b91aa47 100644 --- a/src/text.c +++ b/src/text.c @@ -1466,7 +1466,7 @@ bool do_wrap(void) /* We prepend the wrapped text to the next line, if the prepend_wrap * flag is set, there is a next line, and prepending would not make * the line too long. */ - if (prepend_wrap && rest_length + strlen(line->next->data) <= wrap_at) { + if (prepend_wrap && rest_length + strlenpt(line->next->data) <= wrap_at) { const char *tail = remainder + move_mbleft(remainder, rest_length); /* Go to the end of the line. */