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 | |
| 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')
| -rw-r--r-- | test/snapshots/leader.golden | 45 | ||||
| -rw-r--r-- | test/snapshots/leader.snap | 8 | ||||
| -rw-r--r-- | test/snapshots/windownav.golden | 310 | ||||
| -rw-r--r-- | test/snapshots/windownav.snap | 54 | ||||
| -rw-r--r-- | test/snapshots/windowops.golden | 14 | ||||
| -rw-r--r-- | test/snapshots/windowops.snap | 10 |
6 files changed, 428 insertions, 13 deletions
diff --git a/test/snapshots/leader.golden b/test/snapshots/leader.golden index 201888ec..47b1cb4e 100644 --- a/test/snapshots/leader.golden +++ b/test/snapshots/leader.golden @@ -202,7 +202,7 @@ | 15 SPC t d Debug | 16 SPC t n NextColor | 17 SPC t r Crt -| 18 +| 18 SPC w h Left == snap help-group grid=100x40 cursor=7,22 |Kill Newcol Tutor Debug Colors NextColor Crt Dump | NOR /tmp/pardes-snap/leader/cwd/cmds.txt Save De NOR /tmp/pardes-snap/leader/cwd Del @@ -366,7 +366,48 @@ | 15 SPC t d Debug | 16 SPC t n NextColor | 17 SPC t r Crt -| 18 +| 18 SPC w h Left +== snap help-window grid=100x40 cursor=7,22 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/leader/cwd/cmds.txt Save De NOR /tmp/pardes-snap/leader/cwd Del +| 1 Help +| cmds.txt +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| NOR /tmp/pardes-snap/leader/cwd/+Help Del +| 1 pardes builtins under SPC w +| 2 +| 3 SPC w h Left +| 4 SPC w j Down +| 5 SPC w k Up +| 6 SPC w l Right +| 7 SPC w t Toggleterm +| 8 +| +| +| +| +| +| +| +| +| +| == snap esc-del grid=100x40 cursor=7,2 |Kill Newcol Tutor Debug Colors NextColor Crt Dump | NOR /tmp/pardes-snap/leader/cwd/cmds.txt Save De NOR /tmp/pardes-snap/leader/cwd Del diff --git a/test/snapshots/leader.snap b/test/snapshots/leader.snap index 26d11cd7..0d2dc423 100644 --- a/test/snapshots/leader.snap +++ b/test/snapshots/leader.snap @@ -62,6 +62,14 @@ key ? wait 10000 SPC s r stable 700 15000 snap help-all +# `SPC w ?`: the window group, whose five builtins are the tail of the full +# listing above and fall off the bottom of this pane there +key space +key w +key ? +wait 10000 Toggleterm +stable 700 15000 +snap help-window # Esc in the BODY of an output buffer IS Del: +Help has no file behind it and # nothing worth keeping, so the key that elsewhere only drops a selection # dismisses the whole pane and hands its height back to the pane above. diff --git a/test/snapshots/windownav.golden b/test/snapshots/windownav.golden new file mode 100644 index 00000000..3017fa29 --- /dev/null +++ b/test/snapshots/windownav.golden @@ -0,0 +1,310 @@ +== snap start grid=100x30 cursor=7,2 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/windownav/cwd/w.txt Save De NOR /tmp/pardes-snap/windownav/cwd Del +| 1 alpha +| 2 beta w.txt +| 3 gamma +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap to-term grid=100x30 cursor=54,4 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/windownav/cwd/w.txt Save De NOR /tmp/pardes-snap/windownav/cwd Del +| 1 alpha +| 2 beta w.txt +| 3 gamma +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap back-to-file grid=100x30 cursor=7,2 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/windownav/cwd/w.txt Save De NOR /tmp/pardes-snap/windownav/cwd Del +| 1 alpha +| 2 beta w.txt +| 3 gamma +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap altn grid=100x30 cursor=4,19 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/windownav/cwd/w.txt Save De NOR /tmp/pardes-snap/windownav/cwd Del +| 1 alpha +| 2 beta w.txt +| 3 gamma +| +| +| +| +| +| +| +| +| +| +| +| NOR /tmp/pardes-snap/windownav/cwd Del +| +| w.txt +| +| +| +| +| +| +| +| +| +| +| +== snap up grid=100x30 cursor=7,2 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/windownav/cwd/w.txt Save De NOR /tmp/pardes-snap/windownav/cwd Del +| 1 alpha +| 2 beta w.txt +| 3 gamma +| +| +| +| +| +| +| +| +| +| +| +| NOR /tmp/pardes-snap/windownav/cwd Del +| +| w.txt +| +| +| +| +| +| +| +| +| +| +| +== snap right grid=100x30 cursor=54,4 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/windownav/cwd/w.txt Save De NOR /tmp/pardes-snap/windownav/cwd Del +| 1 alpha +| 2 beta w.txt +| 3 gamma +| +| +| +| +| +| +| +| +| +| +| +| NOR /tmp/pardes-snap/windownav/cwd Del +| +| w.txt +| +| +| +| +| +| +| +| +| +| +| +== snap left grid=100x30 cursor=7,2 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/windownav/cwd/w.txt Save De NOR /tmp/pardes-snap/windownav/cwd Del +| 1 alpha +| 2 beta w.txt +| 3 gamma +| +| +| +| +| +| +| +| +| +| +| +| NOR /tmp/pardes-snap/windownav/cwd Del +| +| w.txt +| +| +| +| +| +| +| +| +| +| +| +== snap down grid=100x30 cursor=4,19 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/windownav/cwd/w.txt Save De NOR /tmp/pardes-snap/windownav/cwd Del +| 1 alpha +| 2 beta w.txt +| 3 gamma +| +| +| +| +| +| +| +| +| +| +| +| NOR /tmp/pardes-snap/windownav/cwd Del +| +| w.txt +| +| +| +| +| +| +| +| +| +| +| +== snap toggle-doc grid=100x30 cursor=7,2 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/windownav/cwd/w.txt Save De NOR /tmp/pardes-snap/windownav/cwd Del +| 1 alpha +| 2 beta w.txt +| 3 gamma +| +| +| +| +| +| +| +| +| +| +| +| NOR /tmp/pardes-snap/windownav/cwd Del +| +| w.txt +| +| +| +| +| +| +| +| +| +| +| +== snap toggle-back grid=100x30 cursor=4,19 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| NOR /tmp/pardes-snap/windownav/cwd/w.txt Save De NOR /tmp/pardes-snap/windownav/cwd Del +| 1 alpha +| 2 beta w.txt +| 3 gamma +| +| +| +| +| +| +| +| +| +| +| +| NOR /tmp/pardes-snap/windownav/cwd Del +| +| w.txt +| +| +| +| +| +| +| +| +| +| +| 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 diff --git a/test/snapshots/windowops.golden b/test/snapshots/windowops.golden index c6282d58..381638c8 100644 --- a/test/snapshots/windowops.golden +++ b/test/snapshots/windowops.golden @@ -246,7 +246,7 @@ | | | -== snap focus-left grid=100x30 cursor=4,19 +== snap focus-right grid=100x30 cursor=44,4 |Kill Newcol Tutor Debug Colors NextColor Crt Dump | NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowops/cwd Del | @@ -277,13 +277,13 @@ | | | -== snap debug-on grid=100x30 cursor=4,19 +== snap debug-on grid=100x30 cursor=44,4 |Kill Newcol Tutor Debug Colors NextColor Crt Dump | NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowo╭────────────────────────────╮ | │pardes resizes=1 │ | w.txt w.txt │terms 4 cols 2 │ -| │active #3 38x13 │ -| │scroll 0/13 │ +| │active #2 58x28 │ +| │scroll 0/28 │ | │pinch 1.0000 │ | │tscroll 0.0000 │ | ╰────────────────────────────╯ @@ -310,7 +310,7 @@ | == style debug-on |0: 0-48 #969696,#2c2a3e, 49-99 d,#2c2a3e, -|1: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-41 d,#383c54, 42-69 #969696,#2c2a3e, 70-99 d,d, +|1: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-41 d,#6e4fd0, 42-69 #969696,#2c2a3e, 70-99 d,d, |2: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-87 #969696,d, 88-98 d,#2a2a2a, 99-99 d,d, |3: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-85 #969696,d, 86-98 d,#2a2a2a, 99-99 d,d, |4: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-86 #969696,d, 87-98 d,#2a2a2a, 99-99 d,d, @@ -325,7 +325,7 @@ |13: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |14: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |15: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, -|16: 0-1 d,#6e4fd0, 2-39 #969696,#2c2a3e, 40-41 d,#525252, 42-99 d,d, +|16: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-41 d,#525252, 42-99 d,d, |17: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |18: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |19: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, @@ -339,7 +339,7 @@ |27: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |28: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |29: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, -== snap debug-off grid=100x30 cursor=4,19 +== snap debug-off grid=100x30 cursor=44,4 |Kill Newcol Tutor Debug Colors NextColor Crt Dump | NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowops/cwd Del | diff --git a/test/snapshots/windowops.snap b/test/snapshots/windowops.snap index 13e35fc5..8e9ba070 100644 --- a/test/snapshots/windowops.snap +++ b/test/snapshots/windowops.snap @@ -1,4 +1,4 @@ -# hover resize hints, border drags, move drag, Alt-n, Ctrl-w focus, Debug box +# hover resize hints, border drags, move drag, Alt-n, Ctrl-w focus (routed through the Right builtin), Debug box file w.txt x start 30 100 -n 3 wait 8000 w.txt @@ -37,10 +37,12 @@ snap moved key a-n stable 700 15000 snap altn -# Ctrl-w h: focus left -key c-w h +# Ctrl-w l: focus right, into the pane just moved to the right column. The +# prefix runs the SAME Right builtin `SPC w l` runs (windownav covers the +# leader side); `h` from here would have nothing to its left to prove. +key c-w l stable 400 5000 -snap focus-left +snap focus-right # Debug overlay on (topbar middle-click on Debug), then off press middle 19 1 release middle 19 1 |
