summaryrefslogtreecommitdiff
path: root/src/config.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-31 01:47:40 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:08 -0300
commitbe404e0d4f91548af6ed600b2fd2027ad8a041c7 (patch)
treefb3597f4f1fe9703a64726c22a3b9eb29609bcdf /src/config.zig
parent8a7112f08e0ce93a37b177e3aa83637e1691b451 (diff)
downloadpardes-be404e0d4f91548af6ed600b2fd2027ad8a041c7.tar.gz
pardes-be404e0d4f91548af6ed600b2fd2027ad8a041c7.zip
focus history is a stack of locations, and the Jumplist is that same stack
One container, not two: focus_hist (a stack of pane ids rebuilt every sync) is now jumps[] + a current pointer, and the +Jumps buffer is a RENDERING of that array — nothing copies it, nothing shadows it. prevFocus, Toggleterm, Look's directory order, Back/Forward, Last and Jumplist all walk the one list. A pane id is reused, so a location that only remembered an id would retarget after a respawn: panes now carry a monotonic serial and an entry whose slot holds a different serial is dead. trackJump compacts those out and fixes the pointer in the same pass. The push rule lives in ONE place and says: a location is worth remembering when you cannot see it any more — a different pane, or more than a bodyful of rows away in the same one. So hjkl never grows the list and 100G, a search hit and a goto-definition do. Ctrl-o/Ctrl-i walk it, SPC j j toggles the last two, SPC j l lists them. Ctrl-i IS Tab on a legacy host, where the binding simply never fires and Tab-executes is untouched; kitty reports them apart. SPC j o/i work anywhere. Two goldens moved, both the SPC ? Help listing gaining four rows.
Diffstat (limited to 'src/config.zig')
-rw-r--r--src/config.zig33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/config.zig b/src/config.zig
index 394f9ca3..c4249270 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -123,6 +123,15 @@ pub const leader_path = std.EnumArray(Builtin, ?[]const u8).init(.{
.Up = "wk",
.Right = "wl",
.Toggleterm = "wt",
+ // the `j` JUMP group, its own letter rather than more of `w`: the window
+ // group moves focus by GEOMETRY (the pane left of this one), these move it
+ // by TIME (the pane I was in before). `o` and `i` are the letters of the
+ // chords that do the same thing, `jj` is the group's obvious verb, and
+ // `jl` is the list itself.
+ .Back = "jo",
+ .Forward = "ji",
+ .Last = "jj",
+ .Jumplist = "jl",
// the two acme verbs: keys and buttons, no leader path — see above
.Look = null,
.Exec = null,
@@ -180,6 +189,29 @@ pub const window_keys = [_]struct { letter: Chord, arrow: Chord, cmd: Builtin }{
pub const new_shell_below: []const Chord = &.{.{ .cp = 'n', .alt = true }};
pub const pane_to_new_column: []const Chord = &.{.{ .cp = 'c', .alt = true }};
+// ---- jumps ----
+
+/// vim's Ctrl-o / Ctrl-i, walking the focus history back and forward. Global
+/// in any mode, like the two Alt- ops above and for the same reason: getting
+/// BACK has to work from inside a pane that owns its keys.
+///
+/// CAREFUL, and this is why the table has a comment: **Ctrl-i is Tab**. On the
+/// wire they are the same byte (0x09), so on a host that speaks only the
+/// legacy encoding this binding never fires and 0x09 keeps meaning `exec_key`
+/// below — which is the right way round, since Tab-executes is the older and
+/// more used of the two. Where the host speaks the kitty keyboard protocol
+/// (`CSI 105;5u`) the two are distinct keys and both work. Shift-Esc
+/// (tty_toggle_alt) is already spelled on that same bet.
+///
+/// Shaped like window_keys: the `cmd` column is what makes the chord
+/// discoverable from the builtin as well as the other way round, and it is
+/// what keeps ONE implementation — pressing the chord and executing the word
+/// `Back` are the same call.
+pub const jump_keys = [_]struct { chord: Chord, cmd: Builtin }{
+ .{ .chord = .{ .cp = 'o', .ctrl = true }, .cmd = .Back },
+ .{ .chord = .{ .cp = 'i', .ctrl = true }, .cmd = .Forward },
+};
+
/// `j` off the topbar drops back onto a tagline — the mirror of the `k` that
/// got you there (window_keys' letter, answered by tagNormalKey).
pub const topbar_down: []const Chord = &.{.{ .cp = 'j' }};
@@ -368,6 +400,7 @@ pub const symbol_marker = " WsSymbols /";
/// these changes only what you read in a tag.
pub const search_buffer = "+Search";
pub const help_buffer = "+Help";
+pub const jumps_buffer = "+Jumps";
pub const hover_buffer = "+Hover";
pub const lsp_buffer = "+Lsp";