summaryrefslogtreecommitdiff
path: root/src/body_layer.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 06:24:42 -0300
committerGabriel Schneider <[email protected]>2026-11-06 11:19:44 -0300
commitc1917b949b9580de8bf0977874a210f0266812da (patch)
tree447dd2235ea00634f662cd3becf4bceb8a895f41 /src/body_layer.zig
parent76c55b5bce0f181b0b15b16596c900397dfef544 (diff)
downloadpardes-c1917b949b9580de8bf0977874a210f0266812da.tar.gz
pardes-c1917b949b9580de8bf0977874a210f0266812da.zip
kinds #14, the core's PDF code gone: pdf.zig and pdf_view.zig leave and every pdf_enabled branch with them; look, Jump, Recent, dumps (one from before the addon opens as its pane), the watch, mouse, keys, the rail and the tag go through Kind for any kind's pane; test/pdf.zig's behaviours are T1 cases over 9P (addons_pdf.zig) and pane cases (a Shadow over a replica, a file changed under it), the harnesses load pdf.so by path
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/body_layer.zig')
-rw-r--r--src/body_layer.zig16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/body_layer.zig b/src/body_layer.zig
index dc5e51bf..56c4bc79 100644
--- a/src/body_layer.zig
+++ b/src/body_layer.zig
@@ -15,7 +15,6 @@ const Color = @import("surface.zig").Color;
const CellStyle = @import("surface.zig").CellStyle;
const Cell = @import("surface.zig").Cell;
const Surface = @import("surface.zig").Surface;
-const pdf_enabled = panes.Pdf.enabled;
const Pane = panes.Pane;
const BOX_H = pardes.BOX_H;
const TAG_TEXT_INSET = pardes.TAG_TEXT_INSET;
@@ -29,7 +28,7 @@ const Layer = @import("Layer.zig");
// ---- drawing a pane body into the surface ----
fn paintTerminalSelection(p: *Pardes, s: *Surface, pane: *Pane, r: Rect, rows: []const Pane.PointerRow, bg: [3]u8, fg: ?[3]u8) void {
- const body = bodyText(p, p.scratch.allocator(), pane) catch return;
+ const body = bodyText(p.scratch.allocator(), pane) catch return;
const raw = pane.body.mode == .tty;
const tx = r.x + config.GUTTER;
const width = r.w -| config.GUTTER;
@@ -248,7 +247,7 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane
};
const tz_body = tracy.zone(@src(), "bodyText");
const probe_text = pardes.FrameStats.nowNs();
- const body = try bodyText(p, arena, pane);
+ const body = try bodyText(arena, pane);
p.frames.zone(.body_text, probe_text);
tz_body.end();
// A select sweep begun on the tag and dragged into the body marks the
@@ -475,21 +474,12 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane
};
}
-pub fn bodyText(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) ![]const u8 {
+pub fn bodyText(arena: std.mem.Allocator, pane: *Pane) ![]const u8 {
if (pane.addon != null) {
const buf = try arena.alloc(u8, pane.rows -| 1);
@memset(buf, '\n');
return buf;
}
- if (pane.hasPdf()) {
- if (comptime pdf_enabled) return panes.Pdf.visibleText(
- pane.pdf.?,
- p.pdf_gpa,
- arena,
- pane.rows -| BOX_H,
- );
- unreachable;
- }
if (pane.file) |*f| return panes.File.bodyText(arena, pane, f);
return panes.terminal.bodyText(arena, pane);
}