summaryrefslogtreecommitdiff
path: root/test/snapshots/cmdword.snap
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 02:27:22 -0300
committerGabriel Schneider <[email protected]>2026-11-05 09:54:56 -0300
commit18e25095a8fe76943a120bcf30225e5a01ab1858 (patch)
tree05fb37cf9fc42fe99b9ecb04dfe1ce0332c969fb /test/snapshots/cmdword.snap
parentd4485660aa6339dbe546a81f4b543d68dfbfa9ec (diff)
downloadpardes-18e25095a8fe76943a120bcf30225e5a01ab1858.tar.gz
pardes-18e25095a8fe76943a120bcf30225e5a01ab1858.zip
snapshots: cmdword, lookpanes and ttylook come back for a directory looked at opening the pane that lists it: cmdword's `@`Look .`` opens the cwd/ pane listing zzmark.txt, whose tag then runs the bare Exec as nothing and the command word as a command pane (a shell's tag typed it into the shell); lookpanes' alpha is its directory pane, through which zqonly.txt and then pick.txt resolve in access order as through the shell in alpha before; ttylook's Return on sub opens the empty sub/ pane, which n leaves for the pane it was looked out of, and its last capture, which looks the `ls` under the cursor into a +Search, is named cursorword for what it pins (it was fileopen, after a big.txt it never opened)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/snapshots/cmdword.snap')
-rw-r--r--test/snapshots/cmdword.snap93
1 files changed, 93 insertions, 0 deletions
diff --git a/test/snapshots/cmdword.snap b/test/snapshots/cmdword.snap
new file mode 100644
index 00000000..34554d6d
--- /dev/null
+++ b/test/snapshots/cmdword.snap
@@ -0,0 +1,93 @@
+# `@`...`` — a word that names a COMMAND instead of a file to open. The
+# delimiters are config.cmd_open/cmd_close and nothing else in the editor knows
+# how one is spelled.
+#
+# A backtick is not a file char, so the ordinary word expansion would stop dead
+# inside one and hand a look the fragment `echo`. config.wordBounds takes the
+# whole run instead, which is what makes a single CLICK the way you invoke one
+# (acme does the same for its own `<`/`|`/`>` command words).
+#
+# EXECUTE runs it, as a command pane, and leaves you where you were; LOOK runs
+# it and lands you in the pane that answered — looking at a thing means being
+# shown it, and a directory's look is a pane listing it, as acme's directory
+# window is.
+#
+# And Look and Exec are ORDINARY BUILTINS now, so their names are executable
+# words like Save or Grep: `Look p.txt` run off the page is the same look a
+# right click on `p.txt` is. Which is also what makes `@`Look .`` nest — Exec
+# unwraps it and the contents go straight back through the one dispatcher.
+file cmds.txt @`echo ZZ''E` @`echo ZZ''L` Look p.txt @`Look .`
+file p.txt just text
+file zzmark.txt x
+# Builtins announce themselves by default, and an announcement is a band at
+# the top of the body -- which would move every row this script clicks. The
+# verbs are what is under test here, not the announcement.
+config Verbose off
+start 31 120 cmds.txt
+wait 8000 Newcol Joincol
+wait 8000 cmds.txt
+stable 700 20000
+snap opened
+# a single middle CLICK inside the run (col 11 is inside `echo`) expands to the
+# whole `@`echo ZZ''E`` and runs it as a command pane; focus stays on the file
+press middle 11 4
+release middle 11 4
+wait 10000 ZZE
+stable 700 15000
+snap atexec
+# LOOK on the second one (col 24, inside its `echo`) runs it too, in the same
+# command pane now its first is done, below it, AND focuses it — that is the
+# whole difference between the two verbs
+press right 24 4
+release right 24 4
+wait 10000 ZZL
+stable 700 15000
+snap atlook
+# `Look p.txt` middle-dragged: the builtin by NAME, with an argument
+press middle 36 4
+drag middle 45 4
+release middle 45 4
+wait 10000 just text
+stable 700 15000
+snap lookword
+# nesting: `@`Look .`` — Exec unwraps it, `Look .` is parsed as the ordinary
+# Look builtin with an argument, and Look opens the directory: a pane named
+# for it with a trailing /, listing it (zzmark.txt is only ever in that
+# listing: no pane here shows it otherwise), which takes the keyboard
+press middle 49 4
+release middle 49 4
+wait 10000 zzmark.txt
+stable 700 15000
+snap nested
+# the same syntax typed into a TAG — the other place the expansion has to know
+# about backticks. The look above left the directory pane focused, so `:`
+# opens ITS tag; `A` appends at the end of it, Esc and `h` put the
+# normal-mode cursor on the last character typed, and the execute key runs
+# the word under it exactly as the body's does.
+key :
+key A
+key space
+text Exec
+key esc
+settle 100
+key h
+key tab
+stable 700 8000
+# ...except that word is `Exec` ITSELF, with nothing to execute. This is the
+# case that must not hang a re-entrant dispatcher: it runs out of argument
+# immediately and does nothing at all. Executing gave the keyboard back to the
+# body, and `:` finds the tag's cursor where it was left.
+snap execword
+# a command word run from that tag runs as a command pane in the directory
+# the pane lists, as a word run from any text pane's tag does
+key :
+key A
+key space
+text @`echo ZZ''T`
+key esc
+settle 100
+key h
+key tab
+wait 10000 ZZT
+stable 700 15000
+snap tagcmd