window: keep soft-wrap whitespace and line breaks out of word look-ahead

The row checks added at the top of the line and token loops in word wrap ran before the whitespace branch could skip whitespace left after a soft wrap. Text that filled the last row and ended in whitespace, such as "abcd " in a 4x1 window, or "abcd" and " " as two segments, reported overflow. The checks now let that whitespace through while soft_wrapped is set, and whitespace that reaches the edge itself now sets soft_wrapped like a word does. A word that follows still reports overflow. The word look-ahead continued into the next segment whenever a word ended its segment, even on a line that ends in a break. LineIterator reports a break for the last line of a segment that contains one, so the next segment starts a new row. With "ab\nx cd" and "ef" in a 5-wide window, "cd" was measured with "ef" and moved down on its own. The look-ahead now stops when the line has a break. It also stops once the word is wider than the window, because the word cannot fit. Co-authored-by: Tim Culverhouse <tim@timculverhouse.com>


Author Amp Co-author Tim Culverhouse Committer Tim Culverhouse Date Commit Parent d62ff130
+42 -4
1 changed file
+42 -4
1 changed file