diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-26 23:50:25 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | a1f26fc4977b185cbd603749157360c011452e5e (patch) | |
| tree | 5702b7316227e1714ae29885f445b2a2f3b00929 /test/snapshots/windownav.snap | |
| parent | d9da3ce9e87cf4c43bf34664031f090e6dde2410 (diff) | |
| download | pardes-a1f26fc4977b185cbd603749157360c011452e5e.tar.gz pardes-a1f26fc4977b185cbd603749157360c011452e5e.zip | |
window navigation builtins: SPC w h/j/k/l focus, SPC w t file<->terminal
Left/Down/Up/Right run the existing focusDir (now taking the pane the
builtin ran on, so an executed name acts on ITS pane); the Ctrl-w prefix
routes through the same four builtins instead of calling focusDir itself.
Toggleterm hops between the most recently focused document and terminal
off focus_hist, the MRU the core already rebuilds each sync.
Ctrl-w stays: a tty-mode pane never sees SPC, so it is the only keyboard
way out of one. Its snapshot step now moves focus somewhere (c-w l), which
the old c-w h in that layout did not.
Diffstat (limited to 'test/snapshots/windownav.snap')
| -rw-r--r-- | test/snapshots/windownav.snap | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test/snapshots/windownav.snap b/test/snapshots/windownav.snap new file mode 100644 index 00000000..0e57fc1e --- /dev/null +++ b/test/snapshots/windownav.snap @@ -0,0 +1,54 @@ +# RULE: moving focus is a BUILTIN like any other, so there is ONE +# implementation and every route reaches it. SPC w h/j/k/l run Left/Down/Up/ +# Right — the geometric focusDir the Ctrl-w prefix also runs — and SPC w t +# runs Toggleterm, the hop between the most recently focused DOCUMENT (a file, +# an image, a +Search/+Help output buffer: things you READ) and the most +# recently focused TERMINAL. "Most recent" is the focus history the core +# already keeps to hand focus back when a pane closes, so the hop back is the +# same key. Focus shows up in the golden's `cursor=` header: that is the +# ACTIVE pane's cursor, so each snap is named by the pane it should land in. +file w.txt alpha\nbeta\ngamma +start 30 100 w.txt +wait 8000 Kill Newcol +wait 8000 w.txt +stable 700 20000 +# left column = the file, right column = the launch shell; the file has focus +snap start +# SPC w t with a shell that has NEVER been focused: nothing to find in the +# history, so it falls back to a scan and still lands in the right column +key space w t +stable 400 5000 +snap to-term +# ...and back, because the file is now the latest document +key space w t +stable 400 5000 +snap back-to-file +# Alt-n: a second shell, below the file — the left column now has two rows +key a-n +stable 700 15000 +snap altn +# SPC w k: up out of that new shell into the file above it +key space w k +stable 400 5000 +snap up +# SPC w l: right, into the launch shell +key space w l +stable 400 5000 +snap right +# SPC w h: left, back into the file column +key space w h +stable 400 5000 +snap left +# SPC w j: down, into the shell under the file +key space w j +stable 400 5000 +snap down +# SPC w t from a terminal: the file, which is the only document here +key space w t +stable 400 5000 +snap toggle-doc +# ...and back to the LATEST terminal — the one just left, not the launch shell +# in the right column, which was focused earlier +key space w t +stable 400 5000 +snap toggle-back |
