diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-31 01:18:53 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:08 -0300 |
| commit | 8a7112f08e0ce93a37b177e3aa83637e1691b451 (patch) | |
| tree | 4a5fe4b0da18cf98cd91950a218ad4a6d324b0cc /test | |
| parent | a77e342eb7fa4add700a96a661226649e8c4763f (diff) | |
| download | pardes-8a7112f08e0ce93a37b177e3aa83637e1691b451.tar.gz pardes-8a7112f08e0ce93a37b177e3aa83637e1691b451.zip | |
Look and Exec are builtins like any other
Their only special feature is now the keys they are assigned. `Look main.zig`
typed in a tag is the same look a right click is; config.look_cmd/exec_cmd
point the two buttons and Enter/Tab at them, so retargeting Enter to Grep is
one line. actOnSelection — a hand-written cascade with the builtin dispatch
nested inside it — is gone, and the `button` parameter it threaded through five
KEYBOARD call sites went with it.
New syntax, spelled once in config.zig: @`ls -la` names a command to run
rather than a file to open. Word expansion takes the quoted run whole, the way
acme does for its own </|/> words, so a click inside one does not hand Look the
fragment `ls`.
And it nests: @`Look .` unwraps, re-enters the dispatcher, and looks at the
directory. Guarded at depth 8, which is unreachable today (every re-entry
strips a word or a delimiter pair, so the string strictly shrinks) and exists
for a future syntax that does not shrink.
leader_path is now optional: a builtin may have no SPC path when its shortcut
is a key and a mouse button. New golden cmdword; the other 59 unmoved.
Diffstat (limited to 'test')
| -rw-r--r-- | test/snapshots/cmdword.golden | 217 | ||||
| -rw-r--r-- | test/snapshots/cmdword.snap | 78 |
2 files changed, 295 insertions, 0 deletions
diff --git a/test/snapshots/cmdword.golden b/test/snapshots/cmdword.golden new file mode 100644 index 00000000..03e272be --- /dev/null +++ b/test/snapshots/cmdword.golden @@ -0,0 +1,217 @@ +== snap opened grid=120x30 cursor=7,2 +|Kill Newcol Tutor Debug NextColor Dump Find Grep Help +| NOR /tmp/pardes-snap/cmdword/cwd/cmds.txt Save Del NOR /tmp/pardes-snap/cmdword/cwd Del +| 1 @`echo ZZ''E` @`echo ZZ''L` Look p.txt @`Look .` +| cmds.txt p.txt zzmark.txt +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap atexec grid=120x30 cursor=7,2 +|Kill Newcol Tutor Debug NextColor Dump Find Grep Help +| NOR /tmp/pardes-snap/cmdword/cwd/cmds.txt Save Del NOR /tmp/pardes-snap/cmdword/cwd Del +| 1 @`echo ZZ''E` @`echo ZZ''L` Look p.txt @`Look .` +| cmds.txt p.txt zzmark.txt +| +| ZZE +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap atlook grid=120x30 cursor=64,8 +|Kill Newcol Tutor Debug NextColor Dump Find Grep Help +| NOR /tmp/pardes-snap/cmdword/cwd/cmds.txt Save Del NOR /tmp/pardes-snap/cmdword/cwd Del +| 1 @`echo ZZ''E` @`echo ZZ''L` Look p.txt @`Look .` +| cmds.txt p.txt zzmark.txt +| +| ZZE +| +| ZZL +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap lookword grid=120x30 cursor=7,17 +|Kill Newcol Tutor Debug NextColor Dump Find Grep Help +| NOR /tmp/pardes-snap/cmdword/cwd/cmds.txt Save Del NOR /tmp/pardes-snap/cmdword/cwd Del +| 1 @`echo ZZ''E` @`echo ZZ''L` Look p.txt @`Look .` +| cmds.txt p.txt zzmark.txt +| +| ZZE +| +| ZZL +| +| +| +| +| +| +| +| +| NOR /tmp/pardes-snap/cmdword/cwd/p.txt Save Del +| 1 just text +| +| +| +| +| +| +| +| +| +| +| +| +== snap nested grid=120x30 cursor=64,10 +|Kill Newcol Tutor Debug NextColor Dump Find Grep Help +| NOR /tmp/pardes-snap/cmdword/cwd/cmds.txt Save Del NOR /tmp/pardes-snap/cmdword/cwd Del +| 1 @`echo ZZ''E` @`echo ZZ''L` Look p.txt @`Look .` +| cmds.txt p.txt zzmark.txt +| +| ZZE +| +| ZZL +| +| cmds.txt p.txt zzmark.txt +| +| +| +| +| +| +| NOR /tmp/pardes-snap/cmdword/cwd/p.txt Save Del +| 1 just text +| +| +| +| +| +| +| +| +| +| +| +| +== snap execword grid=120x30 cursor=102,1 +|Kill Newcol Tutor Debug NextColor Dump Find Grep Help +| NOR /tmp/pardes-snap/cmdword/cwd/cmds.txt Save Del INS /tmp/pardes-snap/cmdword/cwd Del Exec +| 1 @`echo ZZ''E` @`echo ZZ''L` Look p.txt @`Look .` +| cmds.txt p.txt zzmark.txt +| +| ZZE +| +| ZZL +| +| cmds.txt p.txt zzmark.txt +| +| +| +| +| +| +| NOR /tmp/pardes-snap/cmdword/cwd/p.txt Save Del +| 1 just text +| +| +| +| +| +| +| +| +| +| +| +| +== snap tagcmd grid=120x30 cursor=116,1 +|Kill Newcol Tutor Debug NextColor Dump Find Grep Help +| NOR /tmp/pardes-snap/cmdword/cwd/cmds.txt Save Del INS /tmp/pardes-snap/cmdword/cwd Del Exec @`echo ZZ''T` +| 1 @`echo ZZ''E` @`echo ZZ''L` Look p.txt @`Look .` +| cmds.txt p.txt zzmark.txt +| +| ZZE +| +| ZZL +| +| cmds.txt p.txt zzmark.txt +| +| ZZT +| +| +| +| +| NOR /tmp/pardes-snap/cmdword/cwd/p.txt Save Del +| 1 just text +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/test/snapshots/cmdword.snap b/test/snapshots/cmdword.snap new file mode 100644 index 00000000..f4d4fed4 --- /dev/null +++ b/test/snapshots/cmdword.snap @@ -0,0 +1,78 @@ +# `@`...`` — 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 and leaves you where you were; LOOK runs it and lands you in +# the shell that answered — looking at a thing means being shown it, and a +# directory's look has always been exactly that (a shell there, ls'd). +# +# 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 +start 30 120 cmds.txt +wait 8000 Kill Newcol +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 executes it in a shell; focus stays on the file +press middle 11 3 +release middle 11 3 +wait 10000 ZZE +stable 700 15000 +snap atexec +# LOOK on the second one (col 24, inside its `echo`) runs it too AND focuses +# the shell that answered — that is the whole difference between the two verbs +press right 24 3 +release right 24 3 +wait 10000 ZZL +stable 700 15000 +snap atlook +# `Look p.txt` middle-dragged: the builtin by NAME, with an argument +press middle 36 3 +drag middle 45 3 +release middle 45 3 +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 (an existing +# shell there, ls'd — zzmark.txt is only ever in that listing) +press middle 49 3 +release middle 49 3 +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 (tagChordText). The look above left the shell focused, so `:` +# opens ITS tag; `i` then End walks to the end of the tail, and the chord runs +# the word under the cursor exactly as the body's does. +key : +key i +key end +key space +text Exec +key left +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. +snap execword +key end +key space +text @`echo ZZ''T` +key left +key tab +wait 10000 ZZT +stable 700 15000 +snap tagcmd |
