print: fix bounds for word wrap

Let words go all the way to the end

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Tim Culverhouse 2024-03-05 15:46:44 -06:00
parent 7db582b4f3
commit 378984bd87

View file

@ -174,7 +174,7 @@ pub fn print(self: Window, segments: []Segment, opts: PrintOptions) !bool {
// break lines when we can't fit this word, and the word isn't longer // break lines when we can't fit this word, and the word isn't longer
// than our width // than our width
const word_width = self.gwidth(word.bytes); const word_width = self.gwidth(word.bytes);
if (word_width + col >= self.width and word_width < self.width) { if (word_width + col > self.width and word_width < self.width) {
row += 1; row += 1;
col = 0; col = 0;
wrapped = true; wrapped = true;