summaryrefslogtreecommitdiff
path: root/src/keys.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/keys.zig')
-rw-r--r--src/keys.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/keys.zig b/src/keys.zig
index 1329de0b..003f39b5 100644
--- a/src/keys.zig
+++ b/src/keys.zig
@@ -227,6 +227,13 @@ pub fn handleKey(p: *Pardes, key: Key) void {
}
return panes.terminal.forwardKey(p, p.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).
+ if (header == null and pane.focus == .body and pane.prompt == .none) if (pane.addon) |slot| if (slot.takesKeys()) {
+ p.prefix = .none;
+ if (key.cp == Key.escape and !key.ctrl and !key.alt) return exec.runBuiltin(p, .Last, p.active, "", null);
+ if (pardes.Kind.key(p, p.active, key)) return;
+ };
if (p.prefix == .leader) return leaderKey(p, key);
if (p.prefix == .window) {
p.prefix = .none;
@@ -465,6 +472,12 @@ fn leaderKey(p: *Pardes, key: Key) void {
return;
}
}
+ // An addon's word, after the core's (a path the core has is no addon's).
+ switch (pardes.Kind.leader(pfx)) {
+ .word => |w| pardes.Kind.runWord(p, p.active, w, std.mem.span(w.w.name), ""),
+ .prefix => p.prefix = .leader,
+ .none => {},
+ }
}
test "Esc back into a tty leaves its view at the prompt" {