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
parent
cf14ee2ef3
commit
f08d169aa1
|
@ -3000,8 +3000,10 @@ size_t get_softwrap_breakpoint(const char *text, size_t leftedge,
|
||||||
int char_len = 0;
|
int char_len = 0;
|
||||||
/* Length of current character, in bytes. */
|
/* Length of current character, in bytes. */
|
||||||
|
|
||||||
while (*text != '\0' && column < leftedge)
|
while (*text != '\0' && column < leftedge) {
|
||||||
text += parse_mbchar(text, NULL, &column);
|
char_len = parse_mbchar(text, NULL, &column);
|
||||||
|
text += char_len;
|
||||||
|
}
|
||||||
|
|
||||||
/* The intention is to use the entire available width. */
|
/* The intention is to use the entire available width. */
|
||||||
goal_column = leftedge + editwincols;
|
goal_column = leftedge + editwincols;
|
||||||
|
|
Loading…
Reference in New Issue