summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/exec.zig b/src/exec.zig
index c927cb49..eb42424f 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -20,7 +20,6 @@ const python_lang = blk: {
@setEvalBranchQuota(20_000);
break :blk @import("grammar_manifest.zig").byName("python").?;
};
-const pdf_enabled = panes.Pdf.enabled;
const font_picker = pardes.font_picker;
const fonts = pardes.fonts;
const Pane = panes.Pane;
@@ -120,7 +119,7 @@ pub fn operandAt(p: *Pardes, pane: *Pane, clicked: Pane.Sel, borrow: bool, for_l
const wrapped = pane.wrapAt(visible);
const raw = pane.isTerminal() and pane.body.mode == .tty and clicked.r0 >= pane.tag_rows;
const row = if (raw) panes.terminal.gridOffset(pane) + visible else wrapped.line;
- const raw_line = if (raw) modal.lineSlice(body_layer.bodyText(p, p.scratch.allocator(), pane) catch "", @intCast(@max(0, visible))) else "";
+ const raw_line = if (raw) modal.lineSlice(body_layer.bodyText(p.scratch.allocator(), pane) catch "", @intCast(@max(0, visible))) else "";
const col = if (raw)
@as(i32, @intCast(panes.File.rawAtDisplay(raw_line, @intCast(@max(0, clicked.c0)))))
else if (clicked.r0 >= pane.tag_rows)
@@ -270,10 +269,7 @@ fn heldPane(p: *Pardes, first: usize, k: usize) ?*Pane {
pub fn heldSelection(p: *Pardes, first: usize) ?[]const u8 {
for (0..p.panes.len + 2) |k| {
const t = heldPane(p, first, k) orelse continue;
- if (comptime pdf_enabled) if (p.view().frontend.native_images) if (t.pdf) |pv| {
- if (pv.selection != null and pv.selection_text.len > 0)
- return pv.selection_text;
- };
+ if (t.addon) |kind| if (kind.selection.len > 0) return kind.selection;
if (t.sel[sel_slot].state == .done) {
if (edit.selectionText(p, t, t.sel[sel_slot]) catch null) |tx| return tx;
} else if (t.body.vsel.active and t.body.vsel.explicit) {