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>
master
David Lawrence Ramsey 2017-08-16 17:14:30 -05:00 committed by Benno Schulenberg
parent cf14ee2ef3
commit f08d169aa1
1 changed files with 4 additions and 2 deletions

View File

@ -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;