summaryrefslogtreecommitdiff
path: root/test/snapshots/jumps.snap
blob: 9ba0139d6cf9e612f01a9e6ca9ec8f9831b71978 (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
# RULE: there is ONE focus history and it is a stack of LOCATIONS — a pane and
# a spot in it. Ctrl-o walks it back, Ctrl-i walks it forward again, `SPC j j`
# (Last) hops to the newest OTHER pane, and `SPC j l` (Jumplist) writes the
# same stack out as an output buffer whose rows are ordinary look targets, so
# n/N step them. What gets ONTO the stack is decided in one place (trackJump):
# focus ended the update in a different pane, or more than a bodyful of rows
# away in the same one — which is why `100G` below leaves a location behind
# and the j/k that follow it do not.
#
# Focus and position both show in the golden's `cursor=` header: that is the
# ACTIVE pane's cursor, so each snap is named by where it should land.
lines big.txt 200
start 31 150 big.txt
wait 8000 big.txt
stable 700 20000
# a FILE boots alone now, so this is one column holding big.txt, focused, and
# the stack is one entry deep
snap start
# two focus moves. The shell has to be opened before it can be walked to
# (`New`/`Newcol` open an empty +New scratch now, so the shell is asked for by
# name): Alt-n opens it AND focuses it, Alt-c moves it into a column of its
# own on the right — so opening it IS the first of the two moves, and the
# stack below is the same one a shell at boot left. Walking straight back to
# the file does NOT leave `file -> shell -> file` behind: a hop to the entry
# under the top one is the same two places again, so trackJump swaps them
# rather than appending, and the stack is `shell -> file` with the file on top
# (see trackJump).
key a-n
key a-c
stable 700 15000
snap to-shell
key space w h
stable 400 5000
snap to-file
# a FAR motion inside one pane: 100G is a jump, so the line we left is
# remembered and Ctrl-o can come back to it
text 100
key G
stable 400 5000
snap goto-100
# Ctrl-o: back to line 1 of the same pane — a stack of panes could not do this
key c-o
stable 400 5000
snap back-in-file
# ...and back again into the shell
key c-o
stable 400 5000
snap back-to-shell
# Ctrl-i forward, twice: back to line 1 of the file, then line 100 again. Sent as the
# kitty-protocol CSI u (`CSI 105;5u`) because on the wire Ctrl-i IS Tab —
# see config.jump_keys.
send \e[105;5u
stable 400 5000
snap forward-file
send \e[105;5u
stable 400 5000
snap forward-100
# SPC j j — the newest OTHER pane, and pressing it again comes straight back
key space j j
stable 400 5000
snap last
key space j j
stable 400 5000
snap last-back
# SPC j l — the stack as text: `location text` rows, the file naming itself
# and the shell spelled @pN because it has no path
key space j l
stable 700 15000
snap jumplist
# n/N select the next/prev row and Enter looks it, exactly as they do a
# +Search: the stepped span is selected in the buffer (snapstyle) and the Enter
# after it moves the pane the row names. Row 1 is the shell (no path, so
# `@pN`), row 2 the file at line 1, row 4 the file at line 100 — so the body
# visibly rides the list.
#
# ONE PRESS PER ROW, and this buffer is where that rule earns itself: an `@pN`
# row's trailing text is the pane's DIRECTORY, which is a look-able word of its
# own, so rows 1 and 3 used to hold TWO stops each and reaching the next row
# took two steps. A results buffer is a LIST — its rows are locations, and the
# text after one says what is THERE rather than naming another place to go — so
# the walk takes the location at the head of a row and moves on to the next row
# (output_pane.Grain.line). Free text still steps every word: that is the
# terminal walk in ttylook, and it is why the two goldens differ.
#
# An `@pN` row moves focus like any other, which it did not use to: the STEP
# only selects now, and the look Enter runs goes to the pane by the same route
# a path takes.
key n
key enter
stable 700 15000
snap step1-shell
snapstyle step1-shell
# on to row 2 — one press, the directory on row 1 is no longer a stop of its own
key n
key enter
stable 700 15000
snap step2-file
# row 3 is the shell again, then row 4
key n
stable 400 5000
key n
key enter
stable 700 15000
snap step4-line100
# N is the exact inverse: one press back onto row 3's location, and Enter
# follows it to the shell
key N
key enter
stable 700 15000
snap step-back
# and an ordinary LOOK on a row goes there too — the leading word IS a
# location, so the right-click look resolves it like any other path. Row 4
# again, this time by clicking it: the list shows every row, and its row 4 is
# screen row 21.
press right 16 21
release right 16 21
stable 700 15000
snap look-row