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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
# a look resolves against EVERY open pane's directory, in access order: the
# pane the click came from first, then the rest most-recently-focused first,
# and only a word NO directory holds falls through to a search. Two dirs
# (alpha, beta) hold same-named files and the shell's own cwd holds none of
# them, so every look below would have been a search before.
dirmk alpha
dirmk beta
file zzboot.txt x
file alpha/amark.txt a
file alpha/zqonly.txt ONLY-IN-ALPHA
file alpha/pick.txt PICK-FROM-ALPHA
file alpha/twin.txt TWIN-FROM-ALPHA
file alpha/both.txt BOTH-FROM-ALPHA
file beta/pick.txt PICK-FROM-BETA
file beta/twin.txt TWIN-FROM-BETA
file beta/both.txt BOTH-FROM-BETA
# the file argument opens a pane whose directory is beta's, and nothing else —
# so the workdir shell every look below falls through is opened with Alt-n
# (`New`/`Newcol` open an empty +New scratch now, and one inheriting beta's
# directory at that) and Alt-c puts it in a column of its own on the right;
# its first line is a word to look FROM that pane
file beta/bmark.txt both.txt\nb-marker
# Builtins announce themselves by default, and an announcement is a band at
# the top of the body -- which moves every row this script clicks. What the
# verbs do is what is under test, not the announcement.
config Verbose off
# a directory looked at opens a terminal there (DirLook terminal), as this
# script was written for; DirLook pane, the default, is dirpane.snap's
config DirLook terminal
start 51 130 beta/bmark.txt
wait 8000 b-marker
stable 700 20000
key a-n
key a-c
wait 8000 zzboot.txt
stable 700 20000
key space w h
stable 400 5000
# an ordinary dir look on the shell's own ls output: a shell in ./alpha,
# split below it
press right 70 6
release right 70 6
wait 10000 amark.txt
stable 700 20000
# type the words to look into what is left of the workdir shell (past its own
# ls output, on the same row: its last row is the resize handle)
press left 95 5
release left 95 5
stable 400 5000
key i
text zqonly.txt pick.txt twin.txt
key esc
settle 100
stable 400 5000
snap shells
# make the beta pane the most recently focused, so the walk has to pass it
press left 10 5
release left 10 5
stable 700 10000
# zqonly.txt is only under alpha: the clicked shell's cwd fails, beta fails,
# the alpha shell answers. Before, this word became a search.
press right 99 5
release right 99 5
wait 10000 ONLY-IN-ALPHA
stable 700 20000
snap other-dir
# both.txt is in BOTH dirs and alpha is now the most recent (its file pane
# just opened), but the CLICK still wins: looked inside the beta pane it
# opens beta's copy
press right 10 5
release right 10 5
wait 10000 BOTH-FROM-BETA
stable 700 20000
snap clicked-wins
# from a pane whose own dir holds neither copy the access order decides:
# focus the alpha shell, look pick.txt (in both dirs) -> alpha's
press left 70 14
release left 70 14
stable 700 10000
press right 109 5
release right 109 5
wait 10000 PICK-FROM-ALPHA
stable 700 20000
snap mru-alpha
# focus the beta pane instead and the same look flips: twin.txt is in both
# dirs, beta is most recent, beta's copy opens
press left 10 5
release left 10 5
stable 700 10000
press right 118 5
release right 118 5
wait 10000 TWIN-FROM-BETA
stable 700 20000
snap mru-beta
snapstyle mru-beta
|