Skip to content

Commit

Permalink
print: fix bounds for word wrap
Browse files Browse the repository at this point in the history
Let words go all the way to the end

Signed-off-by: Tim Culverhouse <[email protected]>
  • Loading branch information
rockorager committed Mar 5, 2024
1 parent 7db582b commit 378984b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Window.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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
// than our width
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;
col = 0;
wrapped = true;
Expand Down

0 comments on commit 378984b

Please sign in to comment.