summaryrefslogtreecommitdiff
path: root/test/snapshots/scrolloff.snap
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-06 15:07:28 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commit5552ecb3460a8c91d12e0469ba12debe688cc6f8 (patch)
tree100a0c96a0db2f552ad5e356042b9e1a19780d72 /test/snapshots/scrolloff.snap
parentde4def3548a6729b0dfd2120495a61beef8c8c2c (diff)
downloadpardes-5552ecb3460a8c91d12e0469ba12debe688cc6f8.tar.gz
pardes-5552ecb3460a8c91d12e0469ba12debe688cc6f8.zip
scrolloff: keyboard cursor moves keep 3 context rows above/below the cursor (vim scrolloff). One reconcile in Pane.ensureCursorVisible — every keyboard path (normal-mode motions, insert entry/edits, delete/yank/paste/undo/redo) already funnels through it; mouse click/wheel untouched. Clamps: line 0 at top, EOF-at-bottom-row for files (terminals let the vt clamp at the live bottom), margin shrinks on panes shorter than 2*off+1. New scrolloff.snap golden proves j-walk scroll at the margin, gg/top-row reachability, k-walk margin, G bottom clamp. 19/19 snapshots green; no existing goldens changed.
Diffstat (limited to 'test/snapshots/scrolloff.snap')
-rw-r--r--test/snapshots/scrolloff.snap41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/snapshots/scrolloff.snap b/test/snapshots/scrolloff.snap
new file mode 100644
index 00000000..e231e8de
--- /dev/null
+++ b/test/snapshots/scrolloff.snap
@@ -0,0 +1,41 @@
+# scrolloff: keyboard motion keeps 3 context rows above/below the cursor,
+# clamped at file boundaries (cursor may reach the top/bottom body row there)
+lines g.txt 40
+start 30 100
+wait 8000 g.txt
+stable 700 20000
+# right-click the g.txt name in the greeting ls -> file pane, 9 body rows
+press right 4 4
+release right 4 4
+wait 10000 line 3
+stable 700 15000
+press left 10 3
+release left 10 3
+stable 400 5000
+# (b) gg: cursor CAN sit on the top body row, no forced scroll
+key g g
+stable 400 5000
+snap top
+# (a) five j's reach the bottom margin (visual row 5 of 9) without scrolling...
+key j j j j j
+stable 400 5000
+snap edge
+# ...the sixth j scrolls: view slides one line, cursor holds the margin
+key j
+stable 400 5000
+snap scrolled1
+key j j j j
+stable 400 5000
+snap jdown
+# (d) G: bottom clamp, view stops at EOF-at-bottom, cursor on the bottom row
+key G
+stable 400 5000
+snap end
+# (c) k-walk up: cursor climbs to the top margin, then the view scrolls
+key k k k k k k k k
+stable 400 5000
+snap kup
+# (b) again from deep in the file: gg puts the cursor back on the top row
+key g g
+stable 400 5000
+snap top2