summaryrefslogtreecommitdiff
path: root/test/snapshots/tty.snap
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-08 10:44:56 -0300
committerGabriel Schneider <[email protected]>2026-08-10 09:17:07 -0300
commit198889ab8f78b12c9881a20309a792e419ba1386 (patch)
tree264bb756389f4c4cbaf68a6a2aabf3d602450a36 /test/snapshots/tty.snap
parentc3c8bbd8d8add99088c774c54bc1acf1e39ec895 (diff)
downloadpardes-198889ab8f78b12c9881a20309a792e419ba1386.tar.gz
pardes-198889ab8f78b12c9881a20309a792e419ba1386.zip
Esc alternates between the last two panes; Toggleterm is gone
Esc ran Toggleterm, which hopped between the newest DOC and the newest TERMINAL. That distinction never earned its keep. It made Esc unpredictable — which of three panes you landed on depended on their kinds, not on where you had been — and it could not alternate between two files at all, which is the case you hit most. Editing two files, Esc did nothing. The replacement already existed. Last (SPC j j) is "the pane you were in before this one, whichever it was": it walks the jump stack for the newest entry naming a different pane and restores its line and column. So Esc, and Shift-Esc in tty, now run Last, and Toggleterm is deleted rather than renamed — a third implementation of "go to the other pane" was the thing to avoid. SPC w t goes with it; the w group is the four directional moves, and the jump group already had SPC j j. Held down, Esc alternates. Two files, a file and its shell, a file and a +Search — all the same, because Last has no notion of kind to get wrong. This depends on the swap in the same series: Last reads the stack backwards, and until hopping stopped appending, the pane you came from could fall off it. windownav.snap needed only its keys and prose changed — its golden did not move at all, which is the useful evidence here: for the one scenario the old builtin handled well, Last produces an identical focus sequence. Coverage for what it did not handle is new: a unit test opens a second FILE by looking its name and asserts Esc alternates between two panes of the SAME kind, which is the case that used to be a no-op. Docs follow: tutor.txt, docs/helix-keys.md, docs/design.typ, and the builtin index goldens, which are now one row shorter. 75/75 snapshots, both unit suites, and the macOS ABI build all pass.
Diffstat (limited to 'test/snapshots/tty.snap')
-rw-r--r--test/snapshots/tty.snap21
1 files changed, 16 insertions, 5 deletions
diff --git a/test/snapshots/tty.snap b/test/snapshots/tty.snap
index a3af511d..58f4c1ee 100644
--- a/test/snapshots/tty.snap
+++ b/test/snapshots/tty.snap
@@ -1,6 +1,11 @@
-# tty mode round-trip: Ctrl-b in, run a command, Ctrl-b out. Shift-Esc is the
-# same toggle (CSI 27;2u — needs a host that reports modifiers on Escape); a
-# PLAIN Esc is not, it still goes to the shell.
+# tty mode round-trip: Ctrl-b in, run a command, Ctrl-b out. Shift-Esc (CSI
+# 27;2u — needs a host that reports modifiers on Escape) also gets you IN; a
+# PLAIN Esc does not, it still goes to the shell.
+#
+# Getting OUT is Ctrl-b alone. Shift-Esc in tty is what Escape is in normal
+# mode instead — Last, the pane you were in before this one — leaving this pane
+# in tty so coming back lands in the program you left. The hop itself is
+# covered by a unit test in pardes.zig.
file m.txt marker
start 30 100 -n 3
wait 8000 m.txt
@@ -16,10 +21,16 @@ snap tty-echo
key c-b
stable 600 8000
snap tty-off
-# Shift-Esc: in, then out again — the same toggle from the other key
+# Shift-Esc: in, the same as Ctrl-b...
send \e[27;2u
stable 600 8000
snap shift-esc-on
+# ...but not out. With no doc pane to hop to it changes nothing: still tty,
+# prompts still shown, same pane focused.
send \e[27;2u
stable 600 8000
-snap shift-esc-off
+snap shift-esc-nodoc
+# Ctrl-b still leaves tty in place, which is now the only thing that does.
+key c-b
+stable 600 8000
+snap ctrl-b-off