summaryrefslogtreecommitdiff
path: root/test/snapshots/chordcut.snap
blob: b1f164a212ad429669347bfd0f98a74b4f72d8b1 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# acme 1-2/1-3 chords in a file pane: with the left button holding a drag
# selection, tapping middle Cuts it into the snarf (yank) register; tapping
# right Pastes the register (replacing the selection, or splicing at a bare
# click point); cut then paste in ONE hold nets out to copy/Snarf. The left
# release after a chord is inert (the cursor stays where the op left it).
# Also the cancel chords: tapping right during a middle (execute) drag or
# left during a right (look) drag cancels the gesture entirely.
lines f.txt 5
lines g.txt 2
# The narrow-window fallback splits below the source shell and leaves the
# unrelated right column untouched. Give the caller enough cells that the selected
# `echo B''OO g.txt` remains one displayed row; this test is about chords, not
# soft-wrap traversal.
start 31 120 -n 3
wait 8000 f.txt
stable 700 20000
# open f.txt: click a body spot, type the name, look it
press left 5 9
release left 5 9
stable 400 5000
key i
text f.txt
key esc
settle 100
stable 400 5000
press right 6 9
release right 6 9
wait 10000 line 3
stable 700 15000
snap opened
# 1-2 Cut: left-drag over "line" on line 2, tap middle while holding
press left 8 10
drag left 11 10
press middle 11 10
release middle 11 10
release left 11 10
stable 400 5000
snap cut
# 1-2 then 1-3 in one hold = copy: line 3 keeps its text, register loaded
press left 8 11
drag left 11 11
press middle 11 11
release middle 11 11
press right 11 11
release right 11 11
release left 11 11
stable 400 5000
snap copied
# 1-3 at a bare click point: hold left past the end of line 4, tap right —
# the register splices in at the click
press left 14 12
press right 14 12
release right 14 12
release left 14 12
stable 400 5000
snap pointpaste
# 1-3 over a fresh selection replaces it with the register
press left 9 13
drag left 11 13
press right 11 13
release right 11 13
release left 11 13
stable 400 5000
snap replaced
# arm the cancel tests: append `echo B''OO g.txt` to line 2
press left 10 10
release left 10 10
stable 400 5000
key i
text echo B''OO g.txt
key esc
settle 100
stable 400 5000
# 2-3 cancel (acme textselect2): tap right during the middle execute-drag
# over `echo B''OO` — the command never runs (no BOO anywhere)
press middle 10 10
drag middle 19 10
press right 19 10
release right 19 10
release middle 19 10
stable 700 8000
snap cancelexec
# the same drag released clean proves the word was live: BOO appears
press middle 10 10
drag middle 19 10
release middle 19 10
wait 10000 BOO
stable 700 10000
snap execafter
# 3-1 cancel (acme textselect3): tap left during the right look-drag over
# g.txt — no pane opens
press right 21 10
drag right 25 10
press left 25 10
release left 25 10
release right 25 10
stable 700 8000
snap cancellook
# the same look released clean opens g.txt
press right 21 10
drag right 25 10
release right 25 10
wait 10000 line 2
stable 700 10000
snap lookafter
# a fresh left click dismisses the chord's leftover selection instead of
# dragging the anchored span to the click: copy `line` on g.txt line 1
# (styled snap shows the selection), then click the next row (it's gone)
press left 8 24
drag left 11 24
press middle 11 24
release middle 11 24
press right 11 24
release right 11 24
release left 11 24
stable 400 5000
snapstyle chordsel
press left 8 25
release left 8 25
stable 400 5000
snapstyle clickdismiss
# g.txt opened under the lower shell's text and left it three rows: close it,
# and the shell grows back into its rows, for what follows to run in
press middle 59 23
release middle 59 23
stable 700 15000
# tty paste chord: over a mouse-listening app B1 is the app's, so the
# chord's B1 holds Shift (B3 is pardes's either way); the app gets a click
# where the text goes (SGR, body-relative) then the register between
# bracketed-paste markers — cat -v prints the received bytes visibly
press left 35 23
release left 35 23
stable 400 5000
key c-b
stable 600 8000
text stty -icanon -echo; printf '\x1b[?2004h\x1b[?1000h\x1b[?1006h'; cat -v
key enter
stable 700 8000
press shift-left 40 25
press right 40 25
release right 40 25
release shift-left 40 25
stable 700 8000
snap ttyprobe
# a plain prompt (mouse modes off) gets no click bytes — just the paste;
# readline's own 2004 strips the markers and inserts the register text
key c-c
stable 600 8000
text stty sane; printf '\x1b[?1000l\x1b[?1006l'
key enter
stable 600 8000
press left 40 25
press right 40 25
release right 40 25
release left 40 25
stable 700 8000
snap ttyprompt