diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-05 18:46:42 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-10 09:17:07 -0300 |
| commit | 30a44a55232b829866bc3554647de21929276d1a (patch) | |
| tree | 52d59a2e5ac6b4947a0e33845540aa494d7866a0 /test | |
| parent | 4ecf494b3af0ec8d8212dd9614b7e7d329a2251f (diff) | |
| download | pardes-30a44a55232b829866bc3554647de21929276d1a.tar.gz pardes-30a44a55232b829866bc3554647de21929276d1a.zip | |
topbar execute: a selection is only an argument to a builtin that takes one
Diffstat (limited to 'test')
| -rw-r--r-- | test/snapshots/topbarexec.golden | 63 | ||||
| -rw-r--r-- | test/snapshots/topbarexec.snap | 45 |
2 files changed, 108 insertions, 0 deletions
diff --git a/test/snapshots/topbarexec.golden b/test/snapshots/topbarexec.golden new file mode 100644 index 00000000..7d27c4cd --- /dev/null +++ b/test/snapshots/topbarexec.golden @@ -0,0 +1,63 @@ +== snap selected grid=90x20 cursor=14,3 +|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill +| /tmp/pardes-snap/topbarexec/cwd New Del /tmp/pardes-snap/topbarexec/cwd New Del +| +| zmarkfile.txt zmarkfile.txt +| +| +| +| +| +| +| +| /tmp/pardes-snap/topbarexec/cwd New Del +| +| zmarkfile.txt +| +| +| +| +| +| +== snap noarg-runs grid=90x20 cursor=14,3 +|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill +| /tmp/pardes-snap/topbarexec/cwd New Del /tmp/pardes-s╭────────────────────────────╮ +| │pardes resizes=1 │ +| zmarkfile.txt zmarkfile.txt│terms 3 cols 2 │ +| │active #0 43x9 │ +| │scroll 0/9 │ +| │pinch 1.0000 │ +| │tscroll 0.0000 │ +| ╰────────────────────────────╯ +| +| +| /tmp/pardes-snap/topbarexec/cwd New Del +| +| zmarkfile.txt +| +| +| +| +| +| +== snap arg-still-spliced grid=90x20 cursor=14,3 +|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill +| /tmp/pardes-snap/topbarexec/cwd New Del /tmp/pardes-snap/topbarexec/cwd New Del +| +| zmarkfile.txt zmarkfile.txt +| +| +| +| +| +| /tmp/pardes-snap/topbarexec/cwd/+Search New +| 1 zmarkfile.txt +| /tmp/pardes-snap/topbarexec/cwd New Del +| +| zmarkfile.txt +| +| +| +| +| +| diff --git a/test/snapshots/topbarexec.snap b/test/snapshots/topbarexec.snap new file mode 100644 index 00000000..bebaed3f --- /dev/null +++ b/test/snapshots/topbarexec.snap @@ -0,0 +1,45 @@ +# A topbar word runs on a middle click, and it runs WITH whatever is selected: +# sweep a word, click Grep, it greps that word. That is acme's 2-1 chord with +# no drag to chord into, and it is the whole reason the topbar reads the +# selection at all. +# +# But a selection is only an argument to a builtin that has somewhere to put +# one. `Kill`, `Debug`, `NextColor` and the rest match their name WHOLE — that +# is what makes `Kill foo` a shell command and not Kill — so splicing a sweep +# onto them produced a name matching no builtin, which fell out of the builtin +# parser and into a SHELL, as a command nobody typed (`bash: Debug: command +# not found`). It only ever bit you with a terminal open, because that is +# where the stray text went. +# +# So both halves are pinned here, against the same live selection: the no-arg +# builtin runs, and the arg-taking one still gets the word. +file zmarkfile.txt hay ZQNEEDLE stack +start 20 90 -n 3 +wait 8000 zmarkfile.txt +stable 700 20000 +# sweep `zmarkfile.txt` out of the shell's own greeting: an ordinary left drag, +# and the kind of stale highlight that is simply lying around in real use +press left 3 4 +drag left 15 4 +release left 15 4 +stable 700 15000 +snap selected +# Debug takes NO argument. Middle-clicked with that sweep live it must open the +# overlay — not send `Debug zmarkfile.txt` to bash. The box IS the assertion. +press middle 50 1 +release middle 50 1 +stable 700 15000 +snap noarg-runs +# ...and off again, so the overlay does not cover what comes next +press middle 50 1 +release middle 50 1 +stable 700 15000 +# Find DOES take one, and still gets it: the sweep is the pattern, so the +# results buffer names the file it matched. An empty buffer would mean Find +# ran with no argument (which arms the prompt instead), so the ROW is the +# assertion — the splice is what put it there. +press middle 13 1 +release middle 13 1 +wait 10000 +Search +stable 700 15000 +snap arg-still-spliced |
