diff options
Diffstat (limited to 'src/file_pane.zig')
| -rw-r--r-- | src/file_pane.zig | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/file_pane.zig b/src/file_pane.zig index b76a7882..98a72ac4 100644 --- a/src/file_pane.zig +++ b/src/file_pane.zig @@ -191,13 +191,14 @@ pub fn refreshHighlights(p: *Pardes) void { /// readers treat as "rows are lines", so the off path never consults an array. pub fn bodyText(arena: std.mem.Allocator, pane: *Pane, f: *File, wrap: bool) ![]const u8 { var out: std.ArrayList(u8) = .empty; - // min(WRAP_COLS, the pane's own content width), and 0 means don't wrap. - // A pane taller than the map refuses too, rather than recording part of - // itself — see Pane.wrap_line. + // the pane's own content width, less the ONE column the break marker sits + // in — a wrapped row that filled its last cell would have nowhere to say it + // wrapped. 0 means don't wrap. A pane taller than the map refuses too, + // rather than recording part of itself — see Pane.wrap_line. const width: usize = if (!wrap or pane.rows > pane.wrap_line.len) 0 else - @max(1, @min(config.WRAP_COLS, @as(usize, pane.cols -| config.PREFIX_W))); + @max(1, @as(usize, pane.cols -| config.PREFIX_W) -| 1); pane.wrap_n = 0; // start ON the first visible line instead of walking the file to it: this // walk was O(f.scroll) and recolorSyntax below ran the identical one again |
