diff --git a/src/buffer/reflow.zig b/src/buffer/reflow.zig index 76ea9dd..b191a06 100644 --- a/src/buffer/reflow.zig +++ b/src/buffer/reflow.zig @@ -27,7 +27,7 @@ pub fn reflow(allocator: std.mem.Allocator, text: []const u8, width: usize) erro continue :blk .words; }, .words => { - if (line_len + word.len + 1 >= width) { + if (line_len + word.len + 1 >= width - 1) { try writer.writeByte('\n'); line_len = 0; continue :blk .begin;