diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-31 00:26:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | ea228d1b832401db8efe33a5db4099ba41d42509 (patch) | |
| tree | 10a5a7514eca150ba90c188a109c3c604607ef9b /src/output_pane.zig | |
| parent | 19f7322100062b7c1adcde3376063ce6c1d8c72d (diff) | |
| download | pardes-ea228d1b832401db8efe33a5db4099ba41d42509.tar.gz pardes-ea228d1b832401db8efe33a5db4099ba41d42509.zip | |
config.zig: every binding and every piece of Look syntax in one file
Retargeting a key, a mouse chord or a spelling is now an edit to src/config.zig
and nothing else. Three parts in reading order: pardes's own bindings (where a
reader lands), the Look/Exec syntax, then the helix keymap under a banner
saying hxdiff/hxparity are differential suites against real helix, so a key
moved there is a divergence and not a tweak.
The bindings are data a comptime loop can walk, because the builtin index is
going to walk them.
Duplication this cut: is/isC/isA became one hit(key, chords) over ~132 call
sites, and a binding being a LIST collapses the letter-or-arrow chains;
swap_enter_tab is gone, replaced by look_key/exec_key that can point anywhere;
the four focus builtins' h/j/k/l lived hardcoded in two places and is now one
table.
No golden moved.
Diffstat (limited to 'src/output_pane.zig')
| -rw-r--r-- | src/output_pane.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/output_pane.zig b/src/output_pane.zig index 4535495c..64bfc630 100644 --- a/src/output_pane.zig +++ b/src/output_pane.zig @@ -14,6 +14,7 @@ const pardes = @import("pardes.zig"); const Pardes = pardes.Pardes; const Pane = pardes.Pane; const file_pane = @import("file_pane.zig"); +const config = @import("config.zig"); /// `content` is gpa-owned and adopted. The name carries `dir` so looks inside /// the buffer resolve like anywhere else. @@ -51,7 +52,7 @@ pub fn openHelp(p: *Pardes, id: usize, prefix: []const u8) void { for (p.panes, 0..) |slot, i| { const hp = slot orelse continue; const hf = if (hp.file) |*f| f else continue; - if (!hf.output or !std.mem.endsWith(u8, hf.path, "/+Help")) continue; + if (!hf.output or !std.mem.endsWith(u8, hf.path, "/" ++ config.help_buffer)) continue; file_pane.setContent(p, hf, content); hf.scroll = 0; hp.cur_row = 0; @@ -64,7 +65,7 @@ pub fn openHelp(p: *Pardes, id: usize, prefix: []const u8) void { p.gpa.free(content); return; }; - const np = open(p, free, dir, "+Help", content) catch { + const np = open(p, free, dir, config.help_buffer, content) catch { p.gpa.free(content); return; }; |
