summaryrefslogtreecommitdiff
path: root/src/file_pane.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-05 18:02:16 -0300
committerGabriel Schneider <[email protected]>2026-08-10 09:17:07 -0300
commit4ecf494b3af0ec8d8212dd9614b7e7d329a2251f (patch)
tree5a60ea3d69c5fafa62cb259faf0b3a1f4cf85d9f /src/file_pane.zig
parent79a8980e46d8ed1f9ef7e3f4e44db7ee58e9f88e (diff)
downloadpardes-4ecf494b3af0ec8d8212dd9614b7e7d329a2251f.tar.gz
pardes-4ecf494b3af0ec8d8212dd9614b7e7d329a2251f.zip
wrap by default, at the window width, with a break marker
Diffstat (limited to 'src/file_pane.zig')
-rw-r--r--src/file_pane.zig9
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