diff options
Diffstat (limited to 'test/snapshots/tagbottom.snap')
| -rw-r--r-- | test/snapshots/tagbottom.snap | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/test/snapshots/tagbottom.snap b/test/snapshots/tagbottom.snap new file mode 100644 index 00000000..801df1a8 --- /dev/null +++ b/test/snapshots/tagbottom.snap @@ -0,0 +1,154 @@ +# Tagbottom: every pane's tagline on its LAST row instead of its first, and +# the transient message row (prompts, messages, the SPC indicator) at the other +# end with it. One global bool, so the whole screen flips at once. +# +# The two things worth pinning here are not pixels. The first is that a click +# still lands where it looks like it lands: the Sel coordinate space is +# UNCHANGED (row 0 is the tag, the body starts at BOX_H) and the mouse maps a +# screen row into it, so a look or an execute on a bottom tagline acts on the +# word under the pointer instead of silently sweeping whatever body row shares +# that number. Every mouse assertion below is therefore a CONSEQUENCE — a pane +# appearing, a pane going away, a view scrolling by a counted number of rows — +# and not a picture of a highlight. The tagline-execute pair is what caught the +# bug this script exists for: before the tag row got its own arm in the +# execute/look press, both ran a blank body row and a golden recorded the +# no-op as if it had passed. +# The second is that turning it back off restores the top-tagline layout +# exactly: `off` is byte-for-byte `boot`, cursor included. +file top.txt aaa\nbbb\nccc\nddd\neee\nfff\nggg\nhhh\niii\njjj\nkkk\nlll\nmmm\nnnn\nooo\nppp\nqqq\nrrr\nsss\nttt\nuuu\nvvv\nwww\nxxx\nyyy\nzzz +file bottom.txt ZZONE\nZZTWO +start 30 100 top.txt +wait 8000 New Newcol +wait 8000 top.txt +stable 700 20000 +snap boot +# SPC t b. The tag leaves row 1 for row 29, the body slides up one row, and +# the cursor goes with it (7,2 -> 7,1) because it is on the same file line. +key space t b +stable 700 15000 +snap on +# ...and straight back. This grid must equal `boot`'s, to the cell. +key space t b +stable 700 15000 +snap off +key space t b +stable 700 15000 +# CLICK the bottom tagline (col 50 of row 30, the pane's last row) and type +# into it. A clicked tag is insert mode, so the text lands as text, and the +# cursor is down on the tagline with it. Col 50 is past the end of the path, +# which is read-only — a click inside it parks the cursor there and the typing +# goes nowhere. +press left 50 30 +release left 50 30 +stable 400 5000 +send \x20bottom.txt +stable 600 8000 +stable 400 5000 +snap tag-typed +# ...and LOOK the word just typed, from that same bottom tagline: bottom.txt +# opens as a second pane below. It only can if the press was mapped to the tag +# — mapped as a body row it lands on blank line 29 and looks nothing at all. +press right 55 30 +release right 55 30 +wait 10000 ZZONE +stable 700 15000 +snap look-bottom-tag +# a body click in the UPPER pane: the cursor lands on the row under the +# pointer, counted from the pane's first row rather than from a tag that is no +# longer there. Row 6 is grid row 5, the fifth body row, file line 5. +press left 10 6 +release left 10 6 +stable 400 8000 +snap body-cursor +# The h-resize seam. With top taglines it is the upper pane's LAST row; here +# that row is the upper pane's TAG, so the handle is the lower pane's FIRST row +# (grid 16, click row 17). A no-drag click on it must leave both sizes alone. +press left 40 17 +release left 40 17 +motion 40 25 +stable 500 8000 +snap seam-noop +# ...and the real drag, five rows up: the upper pane keeps 10 rows, the lower +# grows to 19. Both taglines follow their own pane's bottom. +press left 40 17 +drag left 40 12 +release left 40 12 +motion 40 25 +stable 500 8000 +snap seam-dragged +# the wheel over the BODY of the upper pane (nine body rows now): four rows +# down, so the view starts at line 5 and the pinned cursor rides up to the +# pane's first row +wheel down 40 4 +wheel down 40 4 +wheel down 40 4 +wheel down 40 4 +stable 400 8000 +snap wheel-body +# ...and one row back up with the wheel over the GUTTER: the same pane, found +# through its gutter column. View at line 4. +wheel up 1 4 +stable 400 8000 +snap wheel-gutter +# a left click in the gutter scrolls UP to the clicked row, and the row it +# counts from is the BODY's first, not r.y + BOX_H. Row 4 is grid row 3, the +# third body row: two rows up, to line 2. Counted from the wrong end it would +# be one row up, to line 3. +press left 1 4 +release left 1 4 +stable 400 8000 +snap gutter-click +# `/` in the lower pane's body arms the search input. The prompt is CUT off the +# tagline and drawn on the message row with the cursor — and with Tagbottom +# those two are at opposite ends of the pane: the tail keeps its builtins on +# row 29 while `/ZZ` and the cursor sit up on row 11, the lower pane's first. +press left 10 14 +release left 10 14 +stable 400 5000 +key / +send ZZ +stable 600 8000 +stable 400 5000 +snap search-prompt +key esc +settle 100 +stable 400 5000 +# the SPC leader indicator lives on that same message row, right-aligned +key space +stable 400 5000 +snap leader +key esc +settle 100 +stable 400 5000 +# THE INVERSION. Sweeping DOWN past the last body row is the ordinary "select +# to the end" gesture, and with the tag drawn BELOW the body it lands on the +# tagline — Sel row 0. Unclamped that drives the selection's far end to the TOP +# of Sel space: the highlight jumps ABOVE the anchor and a 1-2 Cut deletes lines +# nobody swept. Anchored on grid row 3 (file line 4) and dragged onto the upper +# pane's tag row, the sweep must cover lines 4..10 downward, not 2..4 upward. +press left 8 4 +drag left 8 11 +stable 400 5000 +snapstyle sweep-down +# ...and the proof is the BUFFER, not the highlight: 1-2 Cut the sweep, save, +# and read the file back. aaa/bbb/ccc survive and kkk..zzz survive; unclamped +# this file lost bbb/ccc/ddd instead and kept eee onward. +press middle 8 11 +release middle 8 11 +release left 8 11 +stable 400 5000 +snap cut-down +key space f s +stable 700 15000 +snapfile cut-buffer /tmp/pardes-snap/tagbottom/cwd/top.txt +# EXECUTE `Del` on the lower pane's bottom tagline: the pane goes away and the +# upper one takes the whole column back. The middle button's half of the same +# tag mapping the look used above. +press middle 78 30 +release middle 78 30 +stable 700 15000 +snap del-bottom-tag +# and off again, one pane, its tagline back on row 1 with the body under it +key space t b +stable 700 15000 +snap off-again |
