blob: 48d3c627c1a3008c871d816acee591f8928ab2a9 (
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
|
# the touchpad drift guard (config.wheel_guard_ticks). A two-finger swipe that
# is MEANT to be vertical carries a little sideways drift and the pad turns it
# into wheel_left/wheel_right, so the view used to slide sideways under a plain
# scroll. Every vertical tick re-arms the guard; a horizontal tick spends one
# instead of scrolling. SGR codes are vaxis's: 64/65 = wheel up/down (the
# `wheel` command), 66/67 = wheel RIGHT/left, sent raw as hscroll.snap does.
# The drift ticks here are all rightward on purpose: leftward drift at column 0
# is clamped away and would prove nothing.
lines drift.txt 20 _0123456789_abcdefghij_ZEND
start 17 70 drift.txt
wait 8000 drift.txt
stable 700 20000
# the guard protects HSCROLL, and hscroll only exists with soft wrap off (a
# wrapped body has nothing off to the right to drift towards), so turn it off
# first — otherwise every sideways tick is a no-op and the test proves nothing
key space t w
stable 400 5000
snap home
# a drifting swipe: five ticks down with three sideways ones mixed in. The
# view scrolls DOWN five lines and does not move one column sideways.
wheel down 10 5
wheel down 10 5
send \x1b[<66;10;6M
wheel down 10 5
send \x1b[<66;10;6M
send \x1b[<66;10;6M
wheel down 10 5
wheel down 10 5
stable 400 5000
snap drifted
# the guard is armed at 3 now, so a DELIBERATE horizontal swipe pays it off
# first: these three ticks still move nothing (without the guard they would
# have shifted the text 12 columns)
send \x1b[<66;10;6M
send \x1b[<66;10;6M
send \x1b[<66;10;6M
stable 400 5000
snap paying
# ...and from the fourth tick on it scrolls freely: two ticks, 8 columns
send \x1b[<66;10;6M
send \x1b[<66;10;6M
stable 400 5000
snap moved
# vertical again re-arms the guard, so drift is swallowed once more even
# though horizontal was just running
wheel up 10 5
send \x1b[<66;10;6M
send \x1b[<66;10;6M
stable 400 5000
snap rearmed
|