summaryrefslogtreecommitdiff
path: root/src/pardes.zig
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 /src/pardes.zig
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 'src/pardes.zig')
-rw-r--r--src/pardes.zig11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 59233347..75e91ee9 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -7729,7 +7729,7 @@ pub const Pardes = struct {
// hands it back to its body, and a name drafted there is dropped.
if (id != p.active or p.header_focus) {
pane.focus = .body;
- if (pane.prompt == .name) pane.closePrompt();
+ if (pane.prompt == .name and pane.prompt_view == p.view) pane.closePrompt();
}
// A sweep over the tag is the tag's while it has the keyboard.
const swept = pane.sel[sel_slot];
@@ -7822,6 +7822,7 @@ pub const Pardes = struct {
pane.rows = rows;
if (pane.file) |*file| file.syntax_dirty = true;
}
+ pane.pan = panes.terminal.panFor(p, pane, r);
// A directory pane's entries follow its width, as acme's
// columns do (Dir.fit).
if (pane.file) |file| if (file.listing != null and r.h > pane.tag_rows) panes.Dir.fit(p, pane, pane.cols);
@@ -7856,10 +7857,10 @@ pub const Pardes = struct {
/// Whether the live view sizes terminal `pane`: a terminal shown at two
/// sizes takes the size of the view that typed into it last, and any
- /// view's once that one is gone. The others show it at that size.
- // ponytail: a view smaller than the terminal shows its top rows, the
- // rest cut; panning to its cursor, as tmux does, when a small view must
- // follow a busy shell it never types into.
+ /// view's once that one is gone. The others show it at that size, a
+ /// shorter one passed down to its cursor (`Pane.pan`, terminal.panFor).
+ // ponytail: a panned view's pointer reports to a terminal's program and
+ // its kitty images are placed as the unpanned rows are.
fn sizes(p: *Pardes, pane: *Pane) bool {
if (pane.sized_by == p.view) return true;
if (views.isOpen(p, pane.sized_by)) return false;