fix: reflow width is off by one

This commit is contained in:
CJ van den Berg 2026-02-01 19:52:01 +01:00
parent 9f775c9ec8
commit 9c4f30c4ee
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -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;