summaryrefslogtreecommitdiff
path: root/src/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 01:01:35 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit9d2e07e997de155c7dbb894a79e5c11839eab39e (patch)
tree45d09fbe224693b2b9426213e59e56d5b1f35224 /src/panes.zig
parent425d9beb9c977df364ed83743cb2efdef9429478 (diff)
downloadpardes-9d2e07e997de155c7dbb894a79e5c11839eab39e.tar.gz
pardes-9d2e07e997de155c7dbb894a79e5c11839eab39e.zip
Scroll a tag taller than its rows to keep its caret in view
A tag shows at most eight rows, so a longer one (a 9P write of many lines, or `o` in the tag) put its caret on a line that was never drawn. Pane, column and workspace tags now keep a first line on screen that follows the caret while they have the keyboard, and the pointer and the pane text count their rows from it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/panes.zig')
-rw-r--r--src/panes.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/panes.zig b/src/panes.zig
index 3cd66eb7..356f4913 100644
--- a/src/panes.zig
+++ b/src/panes.zig
@@ -125,6 +125,10 @@ pub const Pane = struct {
/// has room for with a body row to spare. Set with the geometry in sync.
/// Pointer rows count from the tag's first, so a body starts at this one.
tag_rows: u16 = 1,
+ /// The tag's first line on screen. A tag with more lines than rows
+ /// scrolls to keep its caret in view while it has the keyboard; pointer
+ /// rows count from this line, not the tag's first.
+ tag_top: u16 = 0,
cwd: Cwd = .none,
hscroll: i32 = 0,
// Visible rows map to source lines and raw/display column origins.