summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-29 19:52:55 -0300
committerGabriel Schneider <[email protected]>2026-10-29 19:53:05 -0300
commit32b80ad0393321d44f929e501e5515bbf6e51c12 (patch)
tree6dbf92426f6f07c1f1c030d542064b48ad6eaca8 /test
parentb3b2768cc82105fa2a1845b7a7a3767c51173afb (diff)
downloadpardes-32b80ad0393321d44f929e501e5515bbf6e51c12.tar.gz
pardes-32b80ad0393321d44f929e501e5515bbf6e51c12.zip
views: a terminal shown in a view shorter than it is passed down to its cursor, a shell's prompt never out of sight, an arrow in the gutter where rows are above; a name drafted in a tag is the view's that opened it
A terminal takes the size of the view that typed into it last; a shorter view used to show its top rows, the prompt below them cut. It now passes over as many as keep the cursor's row in sight, as tmux pans a bigger window in a smaller client: `Pane.pan` (per view, derived) is made in the step's sync and again when a view is drawn out of turn (views.unpark), by terminal.panFor (0 in the view that sizes it, in one tall enough, or folded), and read where the body's rows start: `Pane.scroll`, the body walk in tty mode, the visible cursor. One view never pans: the view that sizes a terminal returns 0 at its first test. A `.name` prompt (a file's name drafted in its tag) is the view's that opened it (`Pane.prompt_view`): another view's step, where that pane has not the keyboard, no longer drops it; its view closing does. views-pan.snap: a shell sized for a 24-row view, its last lines and prompt in a 12-row one under the arrow, then typed into from the short view and sized for it. A unit test: the short view's frame has the cursor's row, and the line on it, inside the pane. docs: the notes, the reference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/snapshots/views-pan.golden52
-rw-r--r--test/snapshots/views-pan.snap27
2 files changed, 79 insertions, 0 deletions
diff --git a/test/snapshots/views-pan.golden b/test/snapshots/views-pan.golden
new file mode 100644
index 00000000..db63d29c
--- /dev/null
+++ b/test/snapshots/views-pan.golden
@@ -0,0 +1,52 @@
+== snap tall grid=80x24 cursor=4,16
+| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit
+| New Tty Find Grep Joincol Delcol
+|$ /tmp/pardes-snap/views-pan/cwd Tty+bash Save Mode Filter Collapse Del
+| 18
+| 19
+| 20
+| 21
+| 22
+| 23
+| 24
+| 25
+| 26
+| 27
+| 28
+| 29
+| 30
+| $
+| /tmp/pardes-snap/views-pan/cwd/+New Save Tty Collapse Del
+| 1
+== snap short-pans grid=60x12 cursor=4,8
+| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes
+| New Tty Find Grep Joincol Delcol
+|$ /tmp/pardes-snap/views-pan/cwd Tty+bash Save Mode Filter C
+| ollapse Del
+|↑ 27
+| 28
+| 29
+| 30
+| $
+| /tmp/pardes-snap/views-pan/cwd/+New Save Tty Collapse Del
+| 1
+== snap short-typed grid=60x12 cursor=4,8
+|4: 29
+|5: 30
+|6: $ echo typed-in-short
+|7: typed-in-short
+== snap tall-sees grid=80x24 cursor=4,7
+|3: 29
+|4: 30
+|5: $ echo typed-in-short
+|6: typed-in-short
+|7: $
+|8:
+|9:
+|10:
+|11:
+|12:
+|13:
+|14:
+|15:
+|16:
diff --git a/test/snapshots/views-pan.snap b/test/snapshots/views-pan.snap
new file mode 100644
index 00000000..3ba1ac5b
--- /dev/null
+++ b/test/snapshots/views-pan.snap
@@ -0,0 +1,27 @@
+# A terminal shown in a view shorter than it (src/views.zig): sized for the
+# tall view that typed into it, the short one passes over its top rows so
+# its cursor and prompt stay in sight, an arrow in the gutter saying rows
+# are above.
+config Verbose off
+start 24 80 views=2
+wait 8000 $
+stable 700 20000
+view 2
+resize 12 60
+stable 500 10000
+view 1
+text seq 1 30
+key enter
+wait 8000 30
+stable 500 10000
+snap tall
+view 2
+stable 500 10000
+snap short-pans
+text echo typed-in-short
+key enter
+stable 500 10000
+snap short-typed
+view 1
+stable 500 10000
+snap tall-sees