summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-08 03:53:22 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commitb13152f89b478466b860aecb2bada8d96f0e9e36 (patch)
tree6d40c79a58afee11d93b11220568eafb165822e4 /test
parentacb5be9e71f0faf3781c7d57cdb0ba829ab3e5c4 (diff)
downloadpardes-b13152f89b478466b860aecb2bada8d96f0e9e36.tar.gz
pardes-b13152f89b478466b860aecb2bada8d96f0e9e36.zip
look focuses an already-loaded pane before any filesystem resolve: the looked word (and its cwd-join) is matched against loaded file/image pane paths first, honoring :NN recentering — so the fs-less web build can focus dump-loaded panes on look, and native dedup no longer needs the file on disk. New lookloaded.snap: look at a path after rm'ing it still focuses/recenters the loaded pane.
Diffstat (limited to 'test')
-rw-r--r--test/snapshots/lookloaded.golden93
-rw-r--r--test/snapshots/lookloaded.snap39
2 files changed, 132 insertions, 0 deletions
diff --git a/test/snapshots/lookloaded.golden b/test/snapshots/lookloaded.golden
new file mode 100644
index 00000000..af90b0ef
--- /dev/null
+++ b/test/snapshots/lookloaded.golden
@@ -0,0 +1,93 @@
+== snap file-open grid=100x30 cursor=7,5
+|Kill Newcol Tutor Debug Colors NextColor Dump
+| NOR /tmp/pardes-snap/lookloaded/cwd/big.txt Save NOR /tmp/pardes-snap/lookloaded/cwd Del
+| 37 line 37
+| 38 line 38 big.txt
+| 39 line 39
+| 40 line 40
+| 41 line 41
+|╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+| NOR /tmp/pardes-snap/lookloaded/cwd Del
+|
+| big.txt
+|
+|
+|
+| big.txt:40 big.txt:10
+|
+| NOR /tmp/pardes-snap/lookloaded/cwd Del
+|
+| big.txt
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== snap removed grid=100x30 cursor=4,10
+|Kill Newcol Tutor Debug Colors NextColor Dump
+| NOR /tmp/pardes-snap/lookloaded/cwd/big.txt Save NOR /tmp/pardes-snap/lookloaded/cwd Del
+| 37 line 37
+| 38 line 38 big.txt
+| 39 line 39
+| 40 line 40
+| 41 line 41
+| 42 line 42
+| NOR /tmp/pardes-snap/lookloaded/cwd Del
+|
+| big.txt
+|
+| GONE
+|
+| big.txt:40 big.txt:10
+|
+| NOR /tmp/pardes-snap/lookloaded/cwd Del
+|
+| big.txt
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== snap look-noFS grid=100x30 cursor=7,5
+|Kill Newcol Tutor Debug Colors NextColor Dump
+| NOR /tmp/pardes-snap/lookloaded/cwd/big.txt Save NOR /tmp/pardes-snap/lookloaded/cwd Del
+| 7 line 7
+| 8 line 8 big.txt
+| 9 line 9
+| 10 line 10
+| 11 line 11
+| 12 line 12
+| NOR /tmp/pardes-snap/lookloaded/cwd Del
+|
+| big.txt
+|
+| GONE
+|
+| big.txt:40 big.txt:10
+|
+| NOR /tmp/pardes-snap/lookloaded/cwd Del
+|
+| big.txt
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
diff --git a/test/snapshots/lookloaded.snap b/test/snapshots/lookloaded.snap
new file mode 100644
index 00000000..03874925
--- /dev/null
+++ b/test/snapshots/lookloaded.snap
@@ -0,0 +1,39 @@
+# a look matches an already-LOADED pane before touching the filesystem: open
+# big.txt:40 from a look, rm the file on disk, then look big.txt:10 — the
+# loaded pane focuses and recenters even though realpath now fails. (This
+# fs-last ordering is what lets the fs-less web build focus dump panes.)
+lines big.txt 60
+start 30 100 -n 3
+wait 8000 big.txt
+stable 700 20000
+press left 5 8
+release left 5 8
+stable 400 5000
+key i
+text big.txt:40 big.txt:10
+key esc
+settle 700
+stable 400 5000
+press right 7 8
+release right 7 8
+stable 700 15000
+snap file-open
+# back to the shell: rm the file from disk in tty mode
+press left 5 11
+release left 5 11
+stable 400 5000
+key c-b
+stable 600 8000
+text rm big.txt; echo GO''NE
+key enter
+wait 8000 GONE
+stable 700 15000
+key c-b
+stable 600 8000
+snap removed
+# look big.txt:10: nothing on disk, but the pane is loaded — it focuses and
+# recenters on line 10 (before this change: realpath fails, look no-ops)
+press right 18 15
+release right 18 15
+stable 700 15000
+snap look-noFS