summaryrefslogtreecommitdiff
path: root/test/snapshots/stepgrain.snap
blob: 3c4d3e4c1de090297861e5b25efe459ba687c176 (plain) (blame)
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
# WHAT ONE PRESS OF `n` TAKES, and why that is not one answer. A pane's rows
# decide it (output_pane.Grain, read in Pardes.lookSpanIn):
#
#   free text — a terminal, a file, a PDF — is stepped WORD by word, several
#   stops to a line, because a line of it may name several places at once (the
#   `ls` row in ttylook.snap hops big.txt -> plain.txt -> sub);
#
#   a RESULTS BUFFER is stepped ROW by row, on the location at the head of the
#   row, because a row there IS one location and the words after it are the
#   MATCHED TEXT — the same hit, spelled out. That text is full of look-able
#   words, and stopping on them was stopping on the same result twice.
#
# This script is the second rule. Row 2 below matched on a line that mentions
# `sub/b.txt`, so the old word-grained walk stopped there before it ever
# reached row 3; now `n` presses and rows correspond one to one, and the fourth
# press wraps the ring back to row 1.
#
# LARGEST from the head, so a path with a BLANK in it is one span rather than
# the word in front of it: `two words.txt` selects whole and opens.
dirmk sub
file a.txt hello ZQMARK one\nsee also sub/b.txt for ZQMARK two
file sub/b.txt ZQMARK inside sub
run touch 'two words.txt'
start 31 150 a.txt
wait 8000 hello ZQMARK
stable 700 20000
# Grep from the leader: three hits, sorted by path, the empty file contributing
# none. Row 2 is the one whose TEXT holds a path.
key space
key f
key g
stable 400 5000
text ZQMARK
key enter
wait 10000 sub/b.txt:1:1
stable 700 15000
snap results
# one press, one row: the head of row 1...
key n
stable 400 5000
snap step-row1
snapstyle step-row1
# ...the head of row 2, and NOT the `sub/b.txt` sitting in its matched text —
# the cursor column is the assertion
key n
stable 400 5000
snap step-row2
snapstyle step-row2
# ...row 3, and then the ring comes round to row 1 again
key n
stable 400 5000
snap step-row3
key n
stable 400 5000
snap step-wrap
# Back into the file, so the Find below is asked from a pane that is not a
# results buffer (fillResults never refills the buffer it was asked from).
press left 8 4
release left 8 4
stable 400 5000
# A path with a blank in it: the row is one span from its first cell, because
# the walk asks about the LONGEST run of the row first and the filesystem is
# what vouches for it. Enter then opens exactly what is selected.
key space
key f
key f
text words
key enter
wait 10000 two words.txt
stable 700 15000
key n
stable 400 5000
snap blank-in-path
snapstyle blank-in-path
key enter
stable 700 15000
snap blank-opened