summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-21 21:42:33 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commit3643635640e97eb2e43730d58fcc46214e21851e (patch)
treea096772d1709492a624bb90f06fdc98a60d142ac /test
parent4e89db185fa4e3bfe4358d2da3b76fad0cc7e547 (diff)
downloadpardes-3643635640e97eb2e43730d58fcc46214e21851e.tar.gz
pardes-3643635640e97eb2e43730d58fcc46214e21851e.zip
Window mode: pick the pane to focus with an outline or a label
Diffstat (limited to 'test')
-rw-r--r--test/panes.zig3
-rw-r--r--test/pdf.zig2
-rw-r--r--test/snapshots/builtins.golden12
-rw-r--r--test/snapshots/builtins.snap11
-rw-r--r--test/snapshots/cornerdrag-left.snap2
-rw-r--r--test/snapshots/delask.golden3
-rw-r--r--test/snapshots/delask.snap4
-rw-r--r--test/snapshots/doccol.snap4
-rw-r--r--test/snapshots/jumps.golden1
-rw-r--r--test/snapshots/jumps.snap2
-rw-r--r--test/snapshots/leader.golden12
-rw-r--r--test/snapshots/leader.snap10
-rw-r--r--test/snapshots/lspdebug.snap6
-rw-r--r--test/snapshots/tagalign2col.golden3
-rw-r--r--test/snapshots/tagalign2col.snap2
-rw-r--r--test/snapshots/tagnav.golden5
-rw-r--r--test/snapshots/tagnav.snap16
-rw-r--r--test/snapshots/windownav.golden8
-rw-r--r--test/snapshots/windownav.snap27
-rw-r--r--test/snapshots/windowops.golden2
-rw-r--r--test/snapshots/windowops.snap10
21 files changed, 72 insertions, 73 deletions
diff --git a/test/panes.zig b/test/panes.zig
index c8f4b7eb..e98e3a54 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -384,6 +384,7 @@ const TagNavigationTests = struct {
fn window(p: *Pardes, letter: u21) void {
p.update(.{ .key = .{ .cp = 'w', .ctrl = true } });
key(p, letter);
+ key(p, Key.enter);
}
test "a tag remembers its cursor, starts on Save, and a click moves it" {
@@ -4718,12 +4719,14 @@ test "cancelled normal gestures leave no count or subprefix after mouse and focu
.focus, .last => {
p.update(.{ .key = .{ .cp = 'w', .ctrl = true } });
p.update(.{ .key = .{ .cp = 'l' } });
+ p.update(.{ .key = .{ .cp = Key.enter } });
try std.testing.expectEqual(other, p.active);
if (gesture == .last) {
p.update(.{ .key = .{ .cp = Key.escape } });
} else {
p.update(.{ .key = .{ .cp = 'w', .ctrl = true } });
p.update(.{ .key = .{ .cp = 'h' } });
+ p.update(.{ .key = .{ .cp = Key.enter } });
}
try std.testing.expectEqual(@as(usize, 0), p.active);
},
diff --git a/test/pdf.zig b/test/pdf.zig
index 6c9308d4..b8a768c8 100644
--- a/test/pdf.zig
+++ b/test/pdf.zig
@@ -1470,9 +1470,11 @@ test "Escape cancels PDF chrome in place and Shift-Escape leaves the pane" {
panes.Pdf.openSections(p, 0);
p.update(.{ .key = .{ .cp = 'w', .ctrl = true } });
p.update(.{ .key = .{ .cp = 'j' } });
+ p.update(.{ .key = .{ .cp = Key.enter } });
try std.testing.expectEqual(@as(usize, 1), p.active);
p.update(.{ .key = .{ .cp = 'w', .ctrl = true } });
p.update(.{ .key = .{ .cp = 'k' } });
+ p.update(.{ .key = .{ .cp = Key.enter } });
try std.testing.expectEqual(@as(usize, 0), p.active);
// Everything a reader can see over the page: a search overlay and a live
diff --git a/test/snapshots/builtins.golden b/test/snapshots/builtins.golden
index 9eb9718b..1836ad05 100644
--- a/test/snapshots/builtins.golden
+++ b/test/snapshots/builtins.golden
@@ -9,14 +9,14 @@
| 5 line 5
| 6 line 6
| 7
-== snap window-group grid=120x67 cursor=7,10
+== snap column-group grid=120x67 cursor=7,10
|9: /tmp/pardes-snap/builtins/cwd/+Help Save Tty Collapse Del
-|10: 1 pardes builtins under SPC w
+|10: 1 pardes builtins under SPC c
|11: 2
-|12: 3 SPC w h Left C-w h, C-w left
-|13: 4 SPC w j Down C-w j, C-w down
-|14: 5 SPC w k Up C-w k, C-w up
-|15: 6 SPC w l Right C-w l, C-w right
+|12: 3 SPC c d Delcol
+|13: 4 SPC c j Joincol topbar
+|14: 5 SPC c n Newcol topbar
+|15: 6 SPC c p Placement
|16: 7
== snap docs-group grid=120x67 cursor=7,10
|10: 1 pardes builtins under SPC h
diff --git a/test/snapshots/builtins.snap b/test/snapshots/builtins.snap
index c59b79d6..73509c24 100644
--- a/test/snapshots/builtins.snap
+++ b/test/snapshots/builtins.snap
@@ -33,6 +33,10 @@ wheel up 110 50
wheel up 110 50
wheel up 110 50
wheel up 110 50
+wheel up 110 50
+wheel up 110 50
+wheel up 110 50
+wheel up 110 50
wait 10000 Look enter, right-click
wait 10000 Exec tab, middle-click
wait 10000 Filter
@@ -43,10 +47,11 @@ stable 700 15000
key space j n space j n space j n
wait 10000 Look enter, right-click
wait 10000 Exec tab, middle-click
-key space w ?
-wait 10000 Right
+key space c ?
+wait 10000 under SPC c
+wait 10000 Joincol
stable 700 15000
-snap window-group
+snap column-group
key space h ?
wait 10000 Tutor
diff --git a/test/snapshots/cornerdrag-left.snap b/test/snapshots/cornerdrag-left.snap
index e76bfb89..3b95c01e 100644
--- a/test/snapshots/cornerdrag-left.snap
+++ b/test/snapshots/cornerdrag-left.snap
@@ -12,7 +12,7 @@ start 31 100 -n 3
wait 8000 w.txt
stable 700 20000
# a second pane in the RIGHT column
-key c-w l
+key c-w l enter
stable 400 5000
key a-n
stable 700 15000
diff --git a/test/snapshots/delask.golden b/test/snapshots/delask.golden
index 7d911239..bded23bf 100644
--- a/test/snapshots/delask.golden
+++ b/test/snapshots/delask.golden
@@ -28,10 +28,9 @@
|
|
| */tmp/pardes-snap/delask/cwd/+New Save Tty Collapse Del
-| 1 bottom-pane Up
+| 1 bottom-pane
== snap asked grid=100x36 cursor=18,20
|20: 1 middle-pane Del: give space to k above j below
-|29: 1 bottom-pane
== snap kept grid=100x36 cursor=18,20
|20: 1 middle-pane
== snap below-took grid=100x36 cursor=18,20
diff --git a/test/snapshots/delask.snap b/test/snapshots/delask.snap
index 9e120f9f..79ab527e 100644
--- a/test/snapshots/delask.snap
+++ b/test/snapshots/delask.snap
@@ -19,7 +19,7 @@ key i
text bottom-pane
key esc
settle 100
-key c-w k
+key c-w k enter
stable 400 5000
snap three
# asked, and nothing closes yet
@@ -45,7 +45,7 @@ key i
text third-pane
key esc
settle 100
-key c-w k
+key c-w k enter
stable 400 5000
key A
send \x20DelBelow
diff --git a/test/snapshots/doccol.snap b/test/snapshots/doccol.snap
index 3a9befa3..bdc5db67 100644
--- a/test/snapshots/doccol.snap
+++ b/test/snapshots/doccol.snap
@@ -10,7 +10,7 @@ file c.txt CCC
# a FILE boots alone (and always outranked -n), so the shell whose ls output
# the looks below are clicked in is opened here: Alt-n stacks it below a.txt
# and Alt-c moves it into a column of its own on the right — the layout the
-# boot used to hand over — and SPC w h comes back to a.txt, which is where the
+# boot used to hand over — and SPC w h Enter comes back to a.txt, which is where the
# boot left focus. (`New`/`Newcol` open an empty +New scratch now, not a
# shell, so the shell has to be asked for by name.)
# Builtins announce themselves by default, and an announcement is a band at
@@ -26,7 +26,7 @@ key a-n
key a-c
wait 8000 c.txt
stable 700 20000
-key space w h
+key space w h enter
stable 400 5000
snap boot
# look b.txt in the shell's ls output: the second doc splits the first, so
diff --git a/test/snapshots/jumps.golden b/test/snapshots/jumps.golden
index 30d1dcea..4aa18d54 100644
--- a/test/snapshots/jumps.golden
+++ b/test/snapshots/jumps.golden
@@ -36,7 +36,6 @@
|3: 1 line 1 ls
|4: 2 line 2 big.txt
== snap to-file grid=150x31 cursor=7,3
-|3: 1 line 1 ls Left
== snap goto-100 grid=150x31 cursor=7,27
|3: 76 line 76 ls
|4: 77 line 77 big.txt
diff --git a/test/snapshots/jumps.snap b/test/snapshots/jumps.snap
index f8d69d2a..7e66aa91 100644
--- a/test/snapshots/jumps.snap
+++ b/test/snapshots/jumps.snap
@@ -29,7 +29,7 @@ key a-n
key a-c
stable 700 15000
snap to-shell
-key space w h
+key space w h enter
stable 400 5000
snap to-file
# a FAR motion inside one pane: 100G is a jump, so the line we left is
diff --git a/test/snapshots/leader.golden b/test/snapshots/leader.golden
index 2fdd66b3..a584f201 100644
--- a/test/snapshots/leader.golden
+++ b/test/snapshots/leader.golden
@@ -85,14 +85,14 @@
|38: 3 SPC h c Changelog topbar
|39: 4 SPC h m Messages
|40: 5 SPC h t Tutor topbar
-== snap help-window grid=100x41 cursor=7,6
+== snap help-column grid=100x41 cursor=7,6
|5: /tmp/pardes-snap/leader/cwd/+Help Save Tty Collapse Del
-|6: 1 pardes builtins under SPC w
+|6: 1 pardes builtins under SPC c
|7: 2
-|8: 3 SPC w h Left C-w h, C-w left
-|9: 4 SPC w j Down C-w j, C-w down
-|10: 5 SPC w k Up C-w k, C-w up
-|11: 6 SPC w l Right C-w l, C-w right
+|8: 3 SPC c d Delcol
+|9: 4 SPC c j Joincol topbar
+|10: 5 SPC c n Newcol topbar
+|11: 6 SPC c p Placement
|12: 7
|35:
|36:
diff --git a/test/snapshots/leader.snap b/test/snapshots/leader.snap
index 02205190..f6068cba 100644
--- a/test/snapshots/leader.snap
+++ b/test/snapshots/leader.snap
@@ -39,7 +39,7 @@ stable 700 15000
snap deleted
# ...and the +Help it squeezed goes too, so the full index below opens with
# room to show it
-key c-w j
+key c-w j enter
key space d
stable 700 15000
@@ -54,10 +54,12 @@ wait 10000 Ascii
wait 10000 Palette
wait 10000 Petscii
wait 10000 Wrap
-key space w ?
-wait 10000 Right
+# SPC w is Window itself now, not a group; the column group stands in
+key space c ?
+wait 10000 under SPC c
+wait 10000 Joincol
stable 700 15000
-snap help-window
+snap help-column
key space l ?
wait 10000 WsDiagnostics
stable 700 15000
diff --git a/test/snapshots/lspdebug.snap b/test/snapshots/lspdebug.snap
index 3aca07cc..ec8d136d 100644
--- a/test/snapshots/lspdebug.snap
+++ b/test/snapshots/lspdebug.snap
@@ -23,7 +23,7 @@ stable 400 10000
key space l w
wait 10000 lsp explain — the definition query
wait 10000 row(s)
-key space w j
+key space w j enter
key space d
stable 700 15000
snap why-closed
@@ -33,7 +33,7 @@ key space l i
wait 10000 backend: lsp-client
wait 10000 protocol servers (lsp-client):
wait 10000 zls
-key space w j
+key space w j enter
key /
text client queries
key enter
@@ -43,7 +43,7 @@ wait 10000 definition
# rows go: k, back to the source above
key space d
key k
-key space w j
+key space w j enter
key space d
stable 700 15000
snap report-closed
diff --git a/test/snapshots/tagalign2col.golden b/test/snapshots/tagalign2col.golden
index 6c4b997a..3fe442db 100644
--- a/test/snapshots/tagalign2col.golden
+++ b/test/snapshots/tagalign2col.golden
@@ -2,11 +2,10 @@
| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit
| New Tty Find Grep Joincol Delcol New Tty Find Grep Joincol Delcol
| /tmp/pardes-snap/tagalign2col/cwd/deep/proj/document.txt Save Tty Collapse Del /tmp/pardes-snap/tagalign2col/cwd Tty+bash Save Mode Filter Collapse Del
-| 1 alpha ls Left
+| 1 alpha ls
| 2 beta deep
| 3 gamma
== snap aligned grid=160x31 cursor=4,9
-|3: 1 alpha ls
|6: /tmp/pardes-snap/tagalign2col/cwd Tty+bash Save Mode Filter Collapse Del
|7: ls
|8: deep
diff --git a/test/snapshots/tagalign2col.snap b/test/snapshots/tagalign2col.snap
index 0849ffae..7bd99ff5 100644
--- a/test/snapshots/tagalign2col.snap
+++ b/test/snapshots/tagalign2col.snap
@@ -10,7 +10,7 @@ stable 700 20000
key a-n
key a-c
stable 700 15000
-key space w h
+key space w h enter
stable 400 5000
snap onecol
# A left sibling does not move either existing tag's command text.
diff --git a/test/snapshots/tagnav.golden b/test/snapshots/tagnav.golden
index 5abfbc3a..e7c6eca4 100644
--- a/test/snapshots/tagnav.golden
+++ b/test/snapshots/tagnav.golden
@@ -8,16 +8,13 @@
| 3 gamma
| /tmp/pardes-snap/tagnav/cwd Tty+bash Save Mode F
| ilter Collapse Del
-| ls Up
+| ls
| w.txt
== snap colon grid=100x31 cursor=36,2
-|9: ls
== snap word grid=100x31 cursor=40,2
== snap in-tag grid=100x31 cursor=42,2
== snap right grid=100x31 cursor=54,6
-|4: 1 alpha Right ls
== snap right-tag grid=100x31 cursor=89,2
-|4: 1 alpha ls
== snap left-tag grid=100x31 cursor=42,2
== snap back-to-body grid=100x31 cursor=7,4
== snap tty-on grid=100x31 cursor=54,6
diff --git a/test/snapshots/tagnav.snap b/test/snapshots/tagnav.snap
index 2f5906bb..cd83dbd9 100644
--- a/test/snapshots/tagnav.snap
+++ b/test/snapshots/tagnav.snap
@@ -15,18 +15,18 @@ wait 8000 Newcol Joincol
wait 8000 w.txt
stable 700 20000
# A FILE boots alone, so the launch shell is opened here: Alt-n opens it and
-# focuses it, Alt-c puts it in a column of its own on the right, SPC w h comes
-# back to the file.
+# focuses it, Alt-c puts it in a column of its own on the right, SPC w h Enter
+# comes back to the file.
key a-n
key a-c
stable 700 15000
-key space w h
+key space w h enter
stable 400 5000
# Alt-n: a shell below the file, so the left column has two rows and every
# direction has somewhere to go
key a-n
stable 700 15000
-key space w k
+key space w k enter
stable 400 5000
snap start
# `:` -> the file's OWN tagline, normal mode, on Save
@@ -43,7 +43,7 @@ stable 400 5000
snap in-tag
# the window keys move between panes from a tag as from a body: the tag lets
# go and the neighbour's BODY takes the keyboard
-key c-w l
+key c-w l enter
stable 400 5000
snap right
# `:` there -> that pane's own tag, on its Save the first time
@@ -51,7 +51,7 @@ key :
stable 400 5000
snap right-tag
# back left, and `:` finds the file's tag cursor where l left it
-key c-w h
+key c-w h enter
stable 400 5000
key :
stable 400 5000
@@ -63,7 +63,7 @@ snap back-to-body
# A TERMINAL KEEPS ITS TTY MODE. Put the launch shell in raw tty mode (Ctrl-b),
# click its tagline and come back: its box reads `$` throughout, because the
# tag's mode is the tag's own.
-key c-w l
+key c-w l enter
stable 400 5000
key c-b
stable 700 15000
@@ -82,7 +82,7 @@ snap tty-restored
# normal mode, then the workspace's; Down comes back the same way.
key c-b
stable 700 15000
-key c-w h
+key c-w h enter
stable 400 5000
key c-w k
stable 400 5000
diff --git a/test/snapshots/windownav.golden b/test/snapshots/windownav.golden
index b4fce259..fa3054af 100644
--- a/test/snapshots/windownav.golden
+++ b/test/snapshots/windownav.golden
@@ -3,7 +3,7 @@
| New Tty Find Grep Joincol Delcol New Tty Find Grep Joincol Delcol
| /tmp/pardes-snap/windownav/cwd/w.txt Save Tty Co /tmp/pardes-snap/windownav/cwd Tty+bash Save Mod
| llapse Del e Filter Collapse Del
-| 1 alpha ls Left
+| 1 alpha ls
| 2 beta w.txt
| 3 gamma
== snap to-term grid=100x31 cursor=54,6
@@ -21,16 +21,10 @@
|9: ls
|10: w.txt
== snap up grid=100x31 cursor=7,4
-|9: ls Up
== snap right grid=100x31 cursor=54,6
-|4: 1 alpha Right ls
-|9: ls
== snap left grid=100x31 cursor=7,4
-|4: 1 alpha ls Left
== snap down grid=100x31 cursor=4,11
-|4: 1 alpha Down ls
== snap toggle-doc grid=100x31 cursor=7,4
-|4: 1 alpha ls
|9: ls Last
== snap toggle-back grid=100x31 cursor=4,11
|4: 1 alpha Last ls
diff --git a/test/snapshots/windownav.snap b/test/snapshots/windownav.snap
index 66509e11..d929bb6f 100644
--- a/test/snapshots/windownav.snap
+++ b/test/snapshots/windownav.snap
@@ -1,6 +1,7 @@
# 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 j j
+# implementation and every route reaches it. SPC w (as Ctrl-w) is window mode:
+# h/j/k/l move an outline by the same geometric nearest pane Left/Down/Up/Right
+# use and Enter focuses it — and SPC j j
# plus body-normal Esc run Last, the hop to the pane you were in BEFORE this
# one, whichever kind it was. It reads the focus history the core already keeps
# to hand focus back when a pane closes, and going somewhere is itself recorded,
@@ -14,13 +15,13 @@ wait 8000 w.txt
stable 700 20000
# A FILE boots alone now, so the terminal every hop below needs is opened here:
# Alt-n opens it and focuses it, Alt-c puts it in a column of its own on the
-# right, SPC w h comes straight back — which also puts the shell on the stack,
+# right, SPC w h Enter comes straight back — which also puts the shell on the stack,
# and Last only ever names a pane that is on it. (`New`/`Newcol` open an empty
# +New scratch now, not a shell.)
key a-n
key a-c
stable 700 15000
-key space w h
+key space w h enter
stable 400 5000
# left column = the file, right column = that shell; the file has focus
snap start
@@ -46,23 +47,23 @@ snap esc-back-to-file
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
+# SPC w k Enter: up out of that new shell into the file above it
+key space w k enter
stable 400 5000
snap up
-# SPC w l: right, into the launch shell
-key space w l
+# SPC w l Enter: right, into the launch shell
+key space w l enter
stable 400 5000
snap right
-# SPC w h: left, back into the file column
-key space w h
+# SPC w h Enter: left, back into the file column
+key space w h enter
stable 400 5000
snap left
-# SPC w j: down, into the shell under the file
-key space w j
+# SPC w j Enter: down, into the shell under the file
+key space w j enter
stable 400 5000
snap down
-# SPC j j from a terminal: the file, which is where SPC w h left off
+# SPC j j from a terminal: the file, which is where SPC w h Enter left off
key space j j
stable 400 5000
snap toggle-doc
diff --git a/test/snapshots/windowops.golden b/test/snapshots/windowops.golden
index 88bd2782..8a6b3986 100644
--- a/test/snapshots/windowops.golden
+++ b/test/snapshots/windowops.golden
@@ -139,7 +139,6 @@
|20: ls
|21: w.txt
== snap focus-right grid=100x31 cursor=44,6
-|20: ls Right
== snap debug-on grid=100x31 cursor=44,6
|1: New Tty Find Grep Joincol Delcol New Tty Find Grep Jo╭────────────────────────────────────╮
|2: /tmp/pardes-snap/windowops/cwd Tty+bas /tmp/pardes-snap/win│pardes resizes=1 │
@@ -151,7 +150,6 @@
|8: │pinch 1.0000 │
|9: │tscroll 0.0000 │
|10: ╰────────────────────────────────────╯
-|20: ls
== style debug-on grid=100x31
|0: 0-1 d,#1d2824, 2-66 #b2c3b8,#1d2824, 67-71 #f5f7ee,#3c614a, 72-72 #f5f7ee,#1d2824, 73-99 #b2c3b8,#1d2824,
|1: 0-1 d,#887455, 2-39 #b2c3b8,#1d2824, 40-41 #b2c3b8,#887455, 42-61 #becfc4,#314738, 62-99 d,d,
diff --git a/test/snapshots/windowops.snap b/test/snapshots/windowops.snap
index 8166f663..e003292c 100644
--- a/test/snapshots/windowops.snap
+++ b/test/snapshots/windowops.snap
@@ -1,4 +1,4 @@
-# hover resize hints, border drags, grip resize, move drag, Alt-n, Ctrl-w focus (routed through the Right builtin), Debug box
+# hover resize hints, border drags, grip resize, move drag, Alt-n, Ctrl-w focus (window mode), Debug box
file w.txt x
start 31 100 -n 3
wait 8000 w.txt
@@ -38,10 +38,10 @@ snap moved
key a-n
stable 700 15000
snap altn
-# 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
+# Ctrl-w l Enter: window mode, the outline right, into the pane just moved to
+# the right column, and Enter focuses it (windownav covers the leader side,
+# SPC w); `h` from here would have nothing to its left to prove.
+key c-w l enter
stable 400 5000
snap focus-right
# Debug overlay on (topbar middle-click on Debug), then off