From 198889ab8f78b12c9881a20309a792e419ba1386 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 8 Aug 2026 10:44:56 -0300 Subject: Esc alternates between the last two panes; Toggleterm is gone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- test/snapshots/grep.golden | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'test/snapshots/grep.golden') diff --git a/test/snapshots/grep.golden b/test/snapshots/grep.golden index f64119a8..ed1086df 100644 --- a/test/snapshots/grep.golden +++ b/test/snapshots/grep.golden @@ -1,6 +1,6 @@ == snap opened grid=180x30 cursor=7,2 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill -| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del | 1 hello TARGET one | 2 nothing here a.txt noise.txt sub a.txt noise.txt sub | 3 last TARGET line @@ -15,7 +15,7 @@ | | | -| /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd New Del | | a.txt noise.txt sub | @@ -31,7 +31,7 @@ | == snap typing grid=180x30 cursor=15,29 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill -| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del | 1 hello TARGET one | 2 nothing here a.txt noise.txt sub a.txt noise.txt sub | 3 last TARGET line @@ -46,7 +46,7 @@ | | | -| /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd New Del | | a.txt noise.txt sub | @@ -62,7 +62,7 @@ | Grep /TARGET == snap results grid=180x30 cursor=7,2 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill -| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del | 1 hello TARGET one | 2 nothing here a.txt noise.txt sub a.txt noise.txt sub | 3 last TARGET line @@ -77,7 +77,7 @@ | | | -| /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd New Del | | a.txt noise.txt sub | @@ -93,7 +93,7 @@ | 3 sub/b.txt:2:1-6 TARGET inside sub == snap first grid=180x30 cursor=18,2 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill -| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del | 1 hello TARGET one | 2 nothing here a.txt noise.txt sub a.txt noise.txt sub | 3 last TARGET line @@ -108,7 +108,7 @@ | | | -| /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd New Del | | a.txt noise.txt sub | @@ -124,7 +124,7 @@ | 3 sub/b.txt:2:1-6 TARGET inside sub == snap opened-hit grid=180x30 cursor=17,4 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill -| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del | 1 hello TARGET one | 2 nothing here a.txt noise.txt sub a.txt noise.txt sub | 3 last TARGET line @@ -139,7 +139,7 @@ | | /tmp/pardes-snap/grep/cwd/sub/b.txt Save New Del | 1 deep -| 2 TARGET inside sub /tmp/pardes-snap/grep/cwd New Del +| 2 TARGET inside sub /tmp/pardes-snap/grep/cwd New Del | | a.txt noise.txt sub | @@ -155,7 +155,7 @@ | 3 sub/b.txt:2:1-6 TARGET inside sub == snap nomatch grid=180x30 cursor=17,4 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill -| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del | 1 hello TARGET one | 2 nothing here a.txt noise.txt sub a.txt noise.txt sub | 3 last TARGET line @@ -170,7 +170,7 @@ | 1 | /tmp/pardes-snap/grep/cwd/sub/b.txt Save New Del | 1 deep -| 2 TARGET inside sub /tmp/pardes-snap/grep/cwd New Del +| 2 TARGET inside sub /tmp/pardes-snap/grep/cwd New Del | | a.txt noise.txt sub | @@ -186,7 +186,7 @@ | 3 sub/b.txt:2:1-6 TARGET inside sub == snap chordsel grid=180x30 cursor=19,2 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill -| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del | 1 hello TARGET one | 2 nothing here a.txt noise.txt sub a.txt noise.txt sub | 3 last TARGET line @@ -201,7 +201,7 @@ | 1 | /tmp/pardes-snap/grep/cwd/sub/b.txt Save New Del | 1 deep -| 2 TARGET inside sub /tmp/pardes-snap/grep/cwd New Del +| 2 TARGET inside sub /tmp/pardes-snap/grep/cwd New Del | | a.txt noise.txt sub | @@ -217,7 +217,7 @@ | 3 sub/b.txt:2:1-6 TARGET inside sub == snap chord grid=180x30 cursor=19,2 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill -| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del +| /tmp/pardes-snap/grep/cwd/a.txt Save New Del /tmp/pardes-snap/grep/cwd New Del /tmp/pardes-snap/grep/cwd New Del | 1 hello TARGET one | 2 nothing here a.txt noise.txt sub a.txt noise.txt sub | 3 last TARGET line @@ -232,7 +232,7 @@ | 1 | /tmp/pardes-snap/grep/cwd/sub/b.txt Save New Del | 1 deep -| 2 TARGET inside sub /tmp/pardes-snap/grep/cwd New Del +| 2 TARGET inside sub /tmp/pardes-snap/grep/cwd New Del | | a.txt noise.txt sub | -- cgit v1.3