summaryrefslogtreecommitdiff
path: root/src/layout.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 00:17:45 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit5354090b6122faf0d18e246a55e8a4ead0955394 (patch)
treef27fc08bba1ceded6bf315125090ef0b64405463 /src/layout.zig
parentc742d19d4bacbd9a91627c4859ca8cb0d11bdba7 (diff)
downloadpardes-5354090b6122faf0d18e246a55e8a4ead0955394.tar.gz
pardes-5354090b6122faf0d18e246a55e8a4ead0955394.zip
Term: output and view through the interface: Term.feed takes one read and the rows the core keeps positions on and gives back a Term.Told (where each went, erased or not, cleared, alive, a pin missed), Term.grid is the plain record of the view and the cursor (total, offset, len, the cursor, whether it shows, the view's row or null while it follows), Term.scroll, Term.follow, Term.viewTo, Term.resize (now or for later) and Term.resizeDeferred move it, Term.cellPixels sizes its cells in pixels and Term.replies hands over what it answered its program; the core's half is the core's: Pane.feedOutput and its row tracking (the edit copy's rows, the cursors and selections, their undo and the pointer's rows, gathered as rows and moved as the feed told, ingestWithPositions's core) and Pane.followOutput, Pane.resizeGrid and Pane.panFor in panes.zig with panes.resizeDeferred, the cursor a program shows read from the grid where the body draws it, tape.viewOnly beside tape.authorityOnly; scrollbar, gridOffset, gridCursor, visibleCursor, viewOf, atBottom and their types go; nothing else changes
Diffstat (limited to 'src/layout.zig')
-rw-r--r--src/layout.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/layout.zig b/src/layout.zig
index fca4c846..73114e45 100644
--- a/src/layout.zig
+++ b/src/layout.zig
@@ -849,7 +849,7 @@ fn blankRows(p: *const Pardes, id: usize) u16 {
// The empty line after a final newline shows nothing.
(panes.File.nlines(p.gpa, f) -| @intFromBool(std.mem.endsWith(u8, f.content, "\n"))) -| f.scroll
else if (pane.isTerminal())
- @as(usize, panes.terminal.gridCursor(pane).y) + 1
+ @as(usize, panes.Term.grid(pane.terminal).cursor_y) + 1
else
rows;
return rows -| @as(u16, @intCast(@min(used, rows)));
@@ -1090,7 +1090,7 @@ pub fn splitBelow(p: *Pardes, src_id: usize, nw: *Pane) void {
// Its tag may wrap to more than one row: the rows under it are its body.
const tag_h = @max(BOX_H, src.tag_rows);
const body: u16 = if (src_h > tag_h) src_h - tag_h else 1;
- const cur: u16 = if (!src.isTerminal()) body / 2 else panes.terminal.gridCursor(src).y + 1;
+ const cur: u16 = if (!src.isTerminal()) body / 2 else panes.Term.grid(src.terminal).cursor_y + 1;
// cap keep so a content-full source still leaves the new pane a tag +
// a few body rows (an Alt-n from a full shell was born 0 rows tall)
// ...and the source min_body_rows of its own (placeNew), when it