summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-31 02:59:58 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:08 -0300
commitf2b8a25d0a25df778bce57efa4c2c7282c71893b (patch)
tree9f4c4ad3bddac13e4b32cb984ec390a7430c87e9 /test
parent7022d738dba00049e820e969cabc34ecbeaea465 (diff)
downloadpardes-f2b8a25d0a25df778bce57efa4c2c7282c71893b.tar.gz
pardes-f2b8a25d0a25df778bce57efa4c2c7282c71893b.zip
a new file splits the doc column you were last working in
placeDoc picked its source by SLOT INDEX — it scanned panes from 0 and took the first doc it found — so which column your file landed in depended on internal id allocation, not on where you had been. It now walks the jump stack backwards to the newest live doc pane. No new state: jumps already IS the record of where the keyboard has been, and Pane.serial is already the "this slot was reused" test. The slot-order scan stays as the fallback, deliberately: a restored dump has one jump entry, and if that pane is a shell the stack knows no doc — without the fallback the next file would claim a second column with docs already open. lookpanes moved: a file now lands under the doc that was actually last read rather than under whichever doc happened to hold the lowest pane id. New golden doccol pins the case the line exists for, and it fails at exactly one capture with the walk disabled.
Diffstat (limited to 'test')
-rw-r--r--test/snapshots/doccol.golden155
-rw-r--r--test/snapshots/doccol.snap43
-rw-r--r--test/snapshots/lookpanes.golden36
3 files changed, 216 insertions, 18 deletions
diff --git a/test/snapshots/doccol.golden b/test/snapshots/doccol.golden
new file mode 100644
index 00000000..a1508b9f
--- /dev/null
+++ b/test/snapshots/doccol.golden
@@ -0,0 +1,155 @@
+== snap boot grid=100x30 cursor=7,2
+|Kill Newcol Tutor Debug NextColor Dump Find Grep Help
+| NOR /tmp/pardes-snap/doccol/cwd/a.txt Save Del NOR /tmp/pardes-snap/doccol/cwd Del
+| 1 AAA
+| a.txt b.txt c.txt
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== snap two-docs grid=100x30 cursor=7,17
+|Kill Newcol Tutor Debug NextColor Dump Find Grep Help
+| NOR /tmp/pardes-snap/doccol/cwd/a.txt Save Del NOR /tmp/pardes-snap/doccol/cwd Del
+| 1 AAA
+| a.txt b.txt c.txt
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+| NOR /tmp/pardes-snap/doccol/cwd/b.txt Save Del
+| 1 BBB
+| 2 B-TWO
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== snap moved grid=100x30 cursor=57,20
+|Kill Newcol Tutor Debug NextColor Dump Find Grep Help
+| NOR /tmp/pardes-snap/doccol/cwd/a.txt Save Del NOR /tmp/pardes-snap/doccol/cwd Del
+| 1 AAA
+| a.txt b.txt c.txt
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+| NOR /tmp/pardes-snap/doccol/cwd/b.txt Save Del
+| 1 BBB
+| 2 B-TWO
+|
+|
+|
+|
+|
+|
+|
+|
+== snap worked grid=100x30 cursor=59,21
+|Kill Newcol Tutor Debug NextColor Dump Find Grep Help
+| NOR /tmp/pardes-snap/doccol/cwd/a.txt Save Del NOR /tmp/pardes-snap/doccol/cwd Del
+| 1 AAA
+| a.txt b.txt c.txt
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+| NOR /tmp/pardes-snap/doccol/cwd/b.txt Save Del
+| 1 BBB
+| 2 B-TWO
+|
+|
+|
+|
+|
+|
+|
+|
+== snap third grid=100x30 cursor=57,26
+|Kill Newcol Tutor Debug NextColor Dump Find Grep Help
+| NOR /tmp/pardes-snap/doccol/cwd/a.txt Save Del NOR /tmp/pardes-snap/doccol/cwd Del
+| 1 AAA
+| a.txt b.txt c.txt
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+| NOR /tmp/pardes-snap/doccol/cwd/b.txt Save Del
+| 1 BBB
+| 2 B-TWO
+|
+|
+|
+| NOR /tmp/pardes-snap/doccol/cwd/c.txt Save Del
+| 1 CCC
+|
+|
+|
diff --git a/test/snapshots/doccol.snap b/test/snapshots/doccol.snap
new file mode 100644
index 00000000..80133c38
--- /dev/null
+++ b/test/snapshots/doccol.snap
@@ -0,0 +1,43 @@
+# A file opened from a terminal joins the column a FILE PANE was last used in.
+# a.txt boots on the left and b.txt joins it there; b.txt is then dragged into
+# the RIGHT column and worked in, so that column is the newest one a doc was
+# read in while a.txt keeps the lowest pane id. The c.txt look then comes from
+# the right shell and must land under b.txt. Slot order — the rule this
+# replaces — would have answered a.txt (pane 0) and put c.txt back on the left.
+file a.txt AAA
+file b.txt BBB\nB-TWO
+file c.txt CCC
+start 30 100 -n 2 a.txt
+wait 8000 c.txt
+stable 700 20000
+snap boot
+# look b.txt in the shell's ls output: the second doc splits the first, so
+# both docs are in the left column and a.txt is the lower-numbered pane
+press right 60 4
+release right 60 4
+wait 10000 BBB
+stable 700 20000
+snap two-docs
+# drag b.txt's layout box (the gutter cells of its tag row) into the right
+# column, below the shell
+press left 1 17
+drag left 75 20
+release left 75 20
+stable 700 15000
+snap moved
+# use a.txt, then b.txt: what counts is the doc last USED, so a.txt being the
+# most recent for a moment must not survive the click into b.txt
+press left 5 3
+release left 5 3
+stable 400 5000
+press left 60 21
+release left 60 21
+key j
+stable 400 5000
+snap worked
+# look c.txt from the shell: below b.txt, in the right column
+press right 67 4
+release right 67 4
+wait 10000 CCC
+stable 700 20000
+snap third
diff --git a/test/snapshots/lookpanes.golden b/test/snapshots/lookpanes.golden
index 93a940c5..03264841 100644
--- a/test/snapshots/lookpanes.golden
+++ b/test/snapshots/lookpanes.golden
@@ -151,7 +151,7 @@
|
|
|
-== snap mru-alpha grid=130x50 cursor=7,9
+== snap mru-alpha grid=130x50 cursor=7,21
|Kill Newcol Tutor Debug NextColor Dump Find Grep Help
| NOR /tmp/pardes-snap/lookpanes/cwd/beta/bmark.txt Save Del NOR /tmp/pardes-snap/lookpanes/cwd Del
| 1 both.txt
@@ -160,20 +160,20 @@
| NOR /tmp/pardes-snap/lookpanes/cwd/alpha Del
|
| amark.txt both.txt pick.txt twin.txt zqonly.txt
-| NOR /tmp/pardes-snap/lookpanes/cwd/alpha/pick.txt Save Del
-| 1 PICK-FROM-ALPHA
|
|
|
|
-| NOR /tmp/pardes-snap/lookpanes/cwd/beta/both.txt Save Del
-| 1 BOTH-FROM-BETA
|
|
+| NOR /tmp/pardes-snap/lookpanes/cwd/beta/both.txt Save Del
+| 1 BOTH-FROM-BETA
|
|
|
|
+| NOR /tmp/pardes-snap/lookpanes/cwd/alpha/pick.txt Save Del
+| 1 PICK-FROM-ALPHA
|
|
|
@@ -202,17 +202,17 @@
|
|
|
-== snap mru-beta grid=130x50 cursor=7,5
+== snap mru-beta grid=130x50 cursor=7,9
|Kill Newcol Tutor Debug NextColor Dump Find Grep Help
| NOR /tmp/pardes-snap/lookpanes/cwd/beta/bmark.txt Save Del NOR /tmp/pardes-snap/lookpanes/cwd Del
| 1 both.txt
| 2 b-marker alpha beta zzboot.txt zqonly.txt pick.txt twin.txt
-| NOR /tmp/pardes-snap/lookpanes/cwd/beta/twin.txt Save Del
-| 1 TWIN-FROM-BETA NOR /tmp/pardes-snap/lookpanes/cwd/alpha Del
+|
+| NOR /tmp/pardes-snap/lookpanes/cwd/alpha Del
|
| amark.txt both.txt pick.txt twin.txt zqonly.txt
-| NOR /tmp/pardes-snap/lookpanes/cwd/alpha/pick.txt Save Del
-| 1 PICK-FROM-ALPHA
+| NOR /tmp/pardes-snap/lookpanes/cwd/beta/twin.txt Save Del
+| 1 TWIN-FROM-BETA
|
|
|
@@ -223,8 +223,8 @@
|
|
|
-|
-|
+| NOR /tmp/pardes-snap/lookpanes/cwd/alpha/pick.txt Save Del
+| 1 PICK-FROM-ALPHA
|
|
|
@@ -258,12 +258,12 @@
|1: 0-1 d,#262626, 2-59 #949494,#121212, 60-64 d,#121212, 65-66 d,#262626, 67-104 #949494,#121212, 105-129 d,#121212,
|2: 0-1 d,#444444, 2-6 #626262,#080808, 7-14 #bdbdbd,#080808, 15-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
|3: 0-1 d,#444444, 2-6 #626262,#080808, 7-14 #bdbdbd,#080808, 15-64 d,#080808, 65-66 d,#444444, 67-121 #bdbdbd,#080808, 122-129 d,#080808,
-|4: 0-1 d,#626262, 2-58 #949494,#121212, 59-64 d,#121212, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
-|5: 0-1 d,#444444, 2-6 #949494,#121212, 7-20 #bdbdbd,#080808, 21-64 d,#080808, 65-66 d,#262626, 67-110 #949494,#121212, 111-129 d,#121212,
+|4: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
+|5: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#262626, 67-110 #949494,#121212, 111-129 d,#121212,
|6: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
|7: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
-|8: 0-1 d,#262626, 2-59 #949494,#121212, 60-64 d,#121212, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
-|9: 0-1 d,#444444, 2-6 #626262,#080808, 7-21 #bdbdbd,#080808, 22-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
+|8: 0-1 d,#626262, 2-58 #949494,#121212, 59-64 d,#121212, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
+|9: 0-1 d,#444444, 2-6 #949494,#121212, 7-20 #bdbdbd,#080808, 21-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
|10: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
|11: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
|12: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
@@ -274,8 +274,8 @@
|17: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
|18: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
|19: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
-|20: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
-|21: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
+|20: 0-1 d,#262626, 2-59 #949494,#121212, 60-64 d,#121212, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
+|21: 0-1 d,#444444, 2-6 #626262,#080808, 7-21 #bdbdbd,#080808, 22-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
|22: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
|23: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,
|24: 0-1 d,#444444, 2-6 #626262,#080808, 7-64 d,#080808, 65-66 d,#444444, 67-129 #bdbdbd,#080808,