From 4ecf494b3af0ec8d8212dd9614b7e7d329a2251f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 5 Aug 2026 18:02:16 -0300 Subject: wrap by default, at the window width, with a break marker --- src/file_pane.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/file_pane.zig') 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 -- cgit v1.3