diff options
Diffstat (limited to 'src/body_layer.zig')
| -rw-r--r-- | src/body_layer.zig | 16 |
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); } |
