summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 19:29:06 -0300
committerGabriel Schneider <[email protected]>2026-11-05 22:03:21 -0300
commit542e6677e23e277ce39edb3e96d729e9adca99d0 (patch)
treef817beb6ac8344b6ae5f33edd6a5365374a02003 /src/builtins.zig
parentc6e5b0aec57394f7459377dae1d3fa45550e7bf0 (diff)
downloadpardes-542e6677e23e277ce39edb3e96d729e9adca99d0.tar.gz
pardes-542e6677e23e277ce39edb3e96d729e9adca99d0.zip
split pardes.zig by noun, keys: the keyboard leaves the session for src/keys.zig, free functions on it as mouse.zig is the mouse: handleKey, leaderKey, replayKeys, cycleMode, toggleTty, questionChoices and answerQuestion; their callers name keys (builtins.zig, ninep/ctl.zig, normal.zig, whose own `keys` are the replayed keys, so it imports the file as keyboard; update calls keys.handleKey); comments citing Pardes.handleKey and Pardes.answerQuestion cite keys; tests moved with them, by name: Esc back into a tty leaves its view at the prompt; Del from a key asks which neighbour takes the rows; nothing else asks; raw tty Esc backs out and Shift-Esc is the program's Esc; with ProgramEsc raw tty Escape only leaves at a shell prompt; the Del question shows only once its delay is up: a quick SPC d j never sees it; raw tty Ctrl-B switches to editor mode without sending child input; raw tty forwards Ctrl letters and former global shortcuts to the child; s in a header selects in the header's own text; a pure move, no field touched, a dump and the wire as they were; gates on tui: core-test 960/960, behaviour-test 238/238
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index 2b7a9c1e..08c41510 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -13,6 +13,7 @@ const panes = @import("panes.zig");
const layout = @import("layout.zig");
const config = @import("config.zig");
const limits = @import("memory.zig").limits;
+const keys = @import("keys.zig");
/// What this build's own frontend draws and its host does: the render's.
pub const frontend: config.Runtime.Capabilities = .{
@@ -1338,7 +1339,7 @@ pub const Diff = struct {
pub const Mode = struct {
pub fn run(c: Ctx) void {
if (c.pane.file == null and !c.pane.isTerminal()) return c.p.reportFailure(c.id, "Mode: only a text or terminal pane has modes");
- c.p.cycleMode(c.id);
+ keys.cycleMode(c.p, c.id);
}
};
@@ -1346,7 +1347,7 @@ pub const Mode = struct {
pub const Togglettymode = struct {
pub const needs: PaneKind = .terminal;
pub fn run(c: Ctx) void {
- c.p.toggleTty(c.id);
+ keys.toggleTty(c.p, c.id);
}
};