commit f08d169aa145fb9432362cfc7e9fbc0669a1f4fb
parent cf14ee2ef32d33a4ea0e53b1037f6918242b8deb
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Wed, 16 Aug 2017 17:14:30 -0500
softwrap: make sure char_len is set when a tab is wider than a chunk
This fixes https://savannah.gnu.org/bugs/?51770,
and fixes https://savannah.gnu.org/bugs/?51768.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -3000,8 +3000,10 @@ size_t get_softwrap_breakpoint(const char *text, size_t leftedge,
int char_len = 0;
/* Length of current character, in bytes. */
- while (*text != '\0' && column < leftedge)
- text += parse_mbchar(text, NULL, &column);
+ while (*text != '\0' && column < leftedge) {
+ char_len = parse_mbchar(text, NULL, &column);
+ text += char_len;
+ }
/* The intention is to use the entire available width. */
goal_column = leftedge + editwincols;