Commit 504a9725 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey Committed by Benno Schulenberg
Browse files

softwrap: break before multi-column Unicode blanks when they overshoot

In atblanks mode, if a softwrapped chunk ends with a double-width space
character (say, Unicode 003000, Ideographic Space), and that would put
half of the character past the edge of the screen, break before it.

This fixes https://savannah.gnu.org/bugs/?51671.
No related merge requests found
Showing with 5 additions and 6 deletions
+5 -6
......@@ -3054,13 +3054,12 @@ size_t get_softwrap_breakpoint(const char *text, size_t leftedge,
* the pointer back to the last blank, step beyond it, and we're done. */
if (found_blank) {
text = text - index + lastblank_index;
parse_mbchar(text, NULL, &lastblank_column);
/* If we've now overshot the screen's edge, then break there. */
if (lastblank_column > goal_column)
return goal_column;
char_len = parse_mbchar(text, NULL, &lastblank_column);
text += char_len;
return lastblank_column;
/* If we haven't overshot the screen's edge, break after the blank. */
if (lastblank_column <= goal_column)
return lastblank_column;
}
/* If a tab is split over two chunks, break at the screen's edge. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment