diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-31 01:47:40 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:08 -0300 |
| commit | be404e0d4f91548af6ed600b2fd2027ad8a041c7 (patch) | |
| tree | fb3597f4f1fe9703a64726c22a3b9eb29609bcdf /test/snapshots/jumps.snap | |
| parent | 8a7112f08e0ce93a37b177e3aa83637e1691b451 (diff) | |
| download | pardes-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 'test/snapshots/jumps.snap')
| -rw-r--r-- | test/snapshots/jumps.snap | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/test/snapshots/jumps.snap b/test/snapshots/jumps.snap new file mode 100644 index 00000000..900b63a1 --- /dev/null +++ b/test/snapshots/jumps.snap @@ -0,0 +1,85 @@ +# RULE: there is ONE focus history and it is a stack of LOCATIONS — a pane and +# a spot in it. Ctrl-o walks it back, Ctrl-i walks it forward again, `SPC j j` +# (Last) hops to the newest OTHER pane, and `SPC j l` (Jumplist) writes the +# same stack out as an output buffer whose rows are ordinary look targets, so +# n/N step them. What gets ONTO the stack is decided in one place (trackJump): +# focus ended the update in a different pane, or more than a bodyful of rows +# away in the same one — which is why `100G` below leaves a location behind +# and the j/k that follow it do not. +# +# Focus and position both show in the golden's `cursor=` header: that is the +# ACTIVE pane's cursor, so each snap is named by where it should land. +lines big.txt 200 +start 30 150 big.txt +wait 8000 big.txt +stable 700 20000 +# left column = big.txt, right column = the launch shell; the file has focus +snap start +# two focus moves, so the stack is file -> shell -> file +key space w l +stable 400 5000 +snap to-shell +key space w h +stable 400 5000 +snap to-file +# a FAR motion inside one pane: 100G is a jump, so the line we left is +# remembered and Ctrl-o can come back to it +text 100 +key G +stable 400 5000 +snap goto-100 +# Ctrl-o: back to line 1 of the same pane — a stack of panes could not do this +key c-o +stable 400 5000 +snap back-in-file +# ...and back again into the shell +key c-o +stable 400 5000 +snap back-to-shell +# Ctrl-i forward, twice: the shell entry, then line 100 again. Sent as the +# kitty-protocol CSI u (`CSI 105;5u`) because on the wire Ctrl-i IS Tab — +# see config.jump_keys. +send \e[105;5u +stable 400 5000 +snap forward-file +send \e[105;5u +stable 400 5000 +snap forward-100 +# SPC j j — the newest OTHER pane, and pressing it again comes straight back +key space j j +stable 400 5000 +snap last +key space j j +stable 400 5000 +snap last-back +# SPC j l — the stack as text: `location text` rows, the file naming itself +# and the shell spelled @pN because it has no path +key space j l +stable 700 15000 +snap jumplist +# n/N step the rows and look them, exactly as they do a +Search: the stepped +# row is selected in the buffer (snapstyle) and the pane it names follows. +# Row 1 is the file at line 1, row 2 the shell (no path, so `@pN`), row 4 the +# file at line 100 — so the body visibly rides the list. +key n +stable 700 15000 +snap step1 +snapstyle step1 +key n +stable 700 15000 +snap step2-shell +key n +stable 700 15000 +key n +stable 700 15000 +snap step4-line100 +key N +stable 700 15000 +snap step-back +# and an ordinary LOOK on a row goes there too — the leading word IS a +# location, so the right-click look resolves it like any other path. Row 4 +# again, this time by clicking it. +press right 16 28 +release right 16 28 +stable 700 15000 +snap look-row |
