1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# The Grep builtin (topbar word, `SPC f g`): `grep -R`, in-core. It arms the
# SAME tag input `/` and Find use, but the walk reads file CONTENTS under every
# pane's directory at once — minus any directory another pane's already
# contains, so a tree two panes sit in is searched ONCE and every hit appears
# once. A row is `path:LINE:COL text` with the path RELATIVE to the directory
# of the pane that asked — the same directory its results buffer is named in,
# so the short name resolves; only a hit from outside that tree stays absolute.
# n/N walk the rows like any other result list, and a row pointing into a file
# nothing has open yet opens it.
dirmk sub
file a.txt hello TARGET one\nnothing here\nlast TARGET line
file sub/b.txt deep\nTARGET inside sub
file noise.txt nothing to see
start 30 180 -n 3
wait 8000 a.txt
stable 700 20000
# open a.txt: a SECOND pane, whose directory the shell's cwd already covers —
# its root is dropped, which is what keeps the hits below un-duplicated
press left 5 8
release left 5 8
stable 400 5000
key i
text a.txt
key esc
settle 100
stable 400 5000
press right 6 8
release right 6 8
wait 10000 hello TARGET
stable 700 15000
snap opened
# middle-click Grep on the topbar (row 1, the word's own column): the input
# arms on the ACTIVE pane's tag, exactly where `/` would have typed
press middle 45 1
release middle 45 1
stable 400 5000
text TARGET
stable 400 5000
snap typing
# Enter walks: two hits in a.txt, one in sub/b.txt, sorted by path — and the
# file that holds none of them contributes no row
key enter
wait 10000 sub/b.txt:2:1
stable 700 15000
snap results
# n looks the first row: absolute path, line 1, column 7 (the `T`)
key n
stable 700 15000
snap first
# ...and stepping on into sub/b.txt opens the file nothing had open
key n
stable 700 15000
key n
wait 10000 TARGET inside sub
stable 700 15000
snap opened-hit
# a pattern nothing holds: an empty list of its own, n has nowhere to go
press middle 45 1
release middle 45 1
stable 400 5000
text zzqq
key enter
stable 700 10000
key n
stable 400 5000
snap nomatch
# the acme chord: a builtin executed with a SELECTION held takes it as the
# argument, so dragging over `TARGET` in a.txt and then clicking Grep runs the
# walk on that word at once — no tag input, nothing typed
press left 14 3
drag left 20 3
release left 20 3
stable 400 5000
snap chordsel
press middle 45 1
release middle 45 1
wait 10000 sub/b.txt:2:1
stable 700 15000
snap chord
|