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
|
# What a language row SPELLS its path as, and that both spellings still LOOK.
#
# A row is written relative to the directory of the file the query was asked
# about (lsp.rel, fed from Req.root) when the answer lives UNDER that directory,
# and keeps its full absolute path when it does not — a `gr` list was otherwise
# the same forty-character prefix repeated down the pane with the part you came
# to read pushed off the right edge, and a path outside the tree has nothing
# short to be called.
#
# A row in the SAME directory shortens to a bare basename; the two that a
# prefix strip can actually get wrong are here, one app each, as `gr` rows:
#
# PARENT the enum is one level UP from the asking file, so nothing is
# stripped and the row carries `/tmp/.../cwd/shade.zig`. This is
# the case that must NOT become `../shade.zig`.
# SUBDIRECTORY the enum is one level DOWN, so the strip leaves a path with a
# separator still in it — `inner/tint.zig`, not `tint.zig`. A
# strip that took the basename instead would produce a row that
# resolves to nothing.
#
# `n` and the Enter after it are the assertion in both, not the row text: the
# step selects row 1, the look opens the right file with the member SELECTED
# on its own line, and focus follows what opened — so the snap header's cursor
# is that pane's, and the style capture is where the selection itself shows.
dirmk sub
dirmk sub/inner
file shade.zig pub const Shade = enum {\n verdigris,\n cinnabar,\n};\n
file sub/inner/tint.zig pub const Tint = enum {\n ochre,\n indigo,\n};\n
file sub/parent.zig const shade = @import("../shade.zig");\n\npub fn pick(s: shade.Shade) u8 {\n return switch (s) {\n \n };\n}\n
file sub/subdir.zig const tint = @import("inner/tint.zig");\n\npub fn hue(t: tint.Tint) u8 {\n return switch (t) {\n \n };\n}\n
# ---- PARENT: outside the asking file's tree, so the row stays absolute ----
start 35 100 sub/parent.zig
wait 8000 fn pick
stable 700 20000
# `gr` on `Shade` in the signature (file line 3, click row 6): its
# declaration's row is in the parent directory.
press left 31 6
release left 31 6
stable 400 5000
key g
key r
wait 15000 cwd/shade.zig:1:
stable 700 15000
snap absrow
key esc
settle 100
# An absolute row has to keep resolving — it is the spelling every row had
# before this, and the one every hit outside the tree still has.
key n
key enter
stable 700 15000
snap abslook
snapstyle abslook
# ---- SUBDIRECTORY: under it, so the strip leaves `inner/tint.zig` ----
start 35 100 sub/subdir.zig
wait 8000 fn hue
stable 700 20000
press left 29 6
release left 29 6
stable 400 5000
key g
key r
wait 15000 inner/tint.zig:1:
stable 700 15000
snap subrow
key esc
settle 100
key n
key enter
stable 700 15000
snap sublook
snapstyle sublook
# The mouse spelling, on the OTHER row (grid row 12, 1-based click row 13). A
# right click expands to the file-ish word under the cursor
# (config.wordBounds), which has to take `inner/tint.zig:3:5-10` WHOLE — the
# separator inside a stripped path is a file char, so the scan runs back over
# `inner/` and stops on the space of the line-number prefix. A look focuses
# what it opens, so the header's cursor is the assertion: the end of `indigo`
# on line 3 of tint.zig.
press right 12 13
release right 12 13
stable 700 15000
snap clicked
|