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
|
# Interactive regex selection (`s` / `S`) and the comment toggle, on a real
# file pane. hxdiff pins what they DO against a real helix, but it is headless,
# so this is the half it cannot see: the prompt living in the TAG rather than a
# popup, the matches lighting up under a pattern as it is typed, Esc putting
# back what was there, and Ctrl-c using the token this file's EXTENSION asks
# for — `//`, where a buffer with no language would get `#`.
file m.zig const one = 1;\nconst two = 2;\nconst three = 3;\n
# wide on purpose: the whole point of this script is a tag long enough to hold
# the marker AND the pattern, and a narrow pane simply truncates it away
start 25 160 m.zig
wait 8000 m.zig
stable 700 20000
key g g
stable 400 5000
# `%` takes the whole file, `s` arms the regex input: the marker goes into the
# tag tail after the path, and the pane is in insert mode ON THE TAG — the
# same one-line editor `/` and Find use, and nothing has moved in the body yet.
key %
key s
stable 400 5000
snap prompt-armed
# ...and now the point: the selection follows the pattern as it is typed. Three
# `const` runs light up with Enter nowhere near, and the colours ARE the
# feature — the primary bright, the other two dim, each with its own cursor.
text const
stable 400 5000
snap preview
snapstyle preview
key enter
stable 400 5000
snap three-selected
snapstyle three-selected
# a second `s` narrows the three to one `t` apiece...
key s
text t
stable 400 5000
snap narrowed
# the grid text cannot show a selection, so this is where the styles carry the
# whole point: three one-cell ranges here, three five-cell ones after the Esc
snapstyle narrowed
# ...and Esc throws that away for the selection the prompt opened on, which is
# free: the preview is re-derived from that snapshot on every keystroke, so
# cancelling is just applying the empty pattern.
key esc
settle 100
stable 400 5000
snap esc-restores
snapstyle esc-restores
# Ctrl-c comments every line the three cursors touch — one decision for the
# whole selection, not one per cursor — and again to take it back off.
key c-c
stable 400 5000
snap commented
key c-c
stable 400 5000
snap uncommented
|