summaryrefslogtreecommitdiff
path: root/test/snapshots/fsearch.snap
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-06 13:54:34 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commit65bffe2c7b7fcdbd82cc112315e64e1bca8dd150 (patch)
treebf7a05fa31931d463ac0e8e8f659727016f275ee /test/snapshots/fsearch.snap
parentde4def3548a6729b0dfd2120495a61beef8c8c2c (diff)
downloadpardes-65bffe2c7b7fcdbd82cc112315e64e1bca8dd150.tar.gz
pardes-65bffe2c7b7fcdbd82cc112315e64e1bca8dd150.zip
file search: / on a file pane types a pattern into the tag tail (the existing modal one-line editor — persistent, no popup); Enter runs grep -nH '<pat>' '<path>' in a shell in the file's dir via the existing exec path (ttyForDir + write effects), so results are ordinary persistent terminal text. n/N walk the result rows of that pane (paneCursorLines already blanks prompt/echo rows via the OSC 133 semantic marks), select the row with the modal line selection, and hand path:NNN: to the existing look (actOnSelection right) which scrolls the file pane there. Esc cancels and restores the tag. State: four Pane fields (search_edit/search_at/search_pane/search_row) — no results mirror, no highlight engine. New snap script fsearch.snap + golden; all 18 frozen goldens stay green (19/19).
Diffstat (limited to 'test/snapshots/fsearch.snap')
-rw-r--r--test/snapshots/fsearch.snap63
1 files changed, 63 insertions, 0 deletions
diff --git a/test/snapshots/fsearch.snap b/test/snapshots/fsearch.snap
new file mode 100644
index 00000000..eab702cb
--- /dev/null
+++ b/test/snapshots/fsearch.snap
@@ -0,0 +1,63 @@
+# `/` file search: the pattern types into the tag (persistent, no popup);
+# Enter runs grep -nH into a shell pane so the results are ordinary terminal
+# text; n/N select the next/prev result row there (prompt rows skipped via the
+# OSC 133 semantic marks) and look it — the file pane scrolls to path:NNN.
+# Esc abandons the input; a no-match search leaves n with nowhere to go.
+file g.txt l1\nMARK a\nl3\nl4\nl5\nMARK b\nl7\nl8\nl9\nMARK c\nl11\nl12
+start 30 120
+wait 8000 g.txt
+stable 700 20000
+# open g.txt: type the name in the shell, look it (as in look-file.snap)
+press left 5 8
+release left 5 8
+stable 400 5000
+key i
+text g.txt
+key esc
+settle 700
+stable 400 5000
+press right 6 8
+release right 6 8
+wait 10000 MARK a
+stable 700 15000
+snap opened
+# / starts the search input in the tag; the pattern is visible while typing
+key /
+stable 400 5000
+text MARK
+stable 400 5000
+snap typing
+key enter
+wait 10000 g.txt:2:MARK
+stable 700 10000
+snap results
+# n selects result 1 in the results pane + scrolls the file to line 2
+key n
+stable 700 15000
+snap first
+snapstyle first
+key n
+stable 700 15000
+snap second
+key n
+stable 700 15000
+snap third
+# N walks back up to result 2 (line 6)
+key N
+stable 700 15000
+snap back
+# Esc abandons the input: the tag tail is restored
+key /
+text zz
+key esc
+settle 700
+stable 400 5000
+snap cancel
+# a no-match search: n has nowhere to go (nothing changes, no crash)
+key /
+text zzqq
+key enter
+stable 700 10000
+key n
+stable 400 5000
+snap nomatch