summaryrefslogtreecommitdiff
path: root/src/keys.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/keys.zig')
-rw-r--r--src/keys.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/keys.zig b/src/keys.zig
index ee14a48a..e6b417a9 100644
--- a/src/keys.zig
+++ b/src/keys.zig
@@ -228,11 +228,12 @@ pub fn handleKey(p: *Pardes, key: Key) void {
return panes.terminal.forwardKey(p, p.view().active, key);
}
// A kind's pane that takes keys takes them all, as a raw terminal
- // does, but Esc, which leaves (and Shift-Esc, above).
+ // does; Esc too, first, when its kind is of 2.1 (a PDF's drops its
+ // search), and not taken it leaves (and Shift-Esc, above, at once).
if (header == null and pane.focus == .body and pane.prompt == .none) if (pane.addon) |slot| if (pardes.Kind.takesKeys(p, slot)) {
p.view().prefix = .none;
- if (key.cp == Key.escape and !key.ctrl and !key.alt) return exec.runBuiltin(p, .Last, p.view().active, "", null);
if (pardes.Kind.key(p, p.view().active, key)) return;
+ if (key.cp == Key.escape and !key.ctrl and !key.alt) return exec.runBuiltin(p, .Last, p.view().active, "", null);
};
if (p.view().prefix == .leader) return leaderKey(p, key);
if (p.view().prefix == .window) {
@@ -367,7 +368,7 @@ pub fn handleKey(p: *Pardes, key: Key) void {
return;
}
edit.pinPaneCursor(p, &pane.body);
- const explicit = (p.view().frontend.native_images and pane.hasPdfSelection()) or
+ const explicit = (if (pane.addon) |k| k.selection.len > 0 else false) or
(pane.body.vsel.active and pane.body.vsel.explicit);
if (explicit) {
if (exec.chordEachSel(p, pane, cmd)) return;
@@ -386,7 +387,6 @@ pub fn handleKey(p: *Pardes, key: Key) void {
mouse.dispatchPointerBuiltin(p, p.view().active, cmd, operand.text, .{ .on_tag = false, .operand = operand });
return;
}
- if (t.mode == .normal and t.what == .body and pane.hasPdf()) return normal.handlePdfNormal(p, pane, key);
if (t.what == .tag and t.mode == .insert and tagline.typedIntoName(p, pane, key)) return;
// A tag's prefix is read-only: a key whose edit reached into it
// changes nothing, not even where the cursor is.