From 9d2e07e997de155c7dbb894a79e5c11839eab39e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 01:01:35 -0300 Subject: 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 --- src/panes.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/panes.zig') 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. -- cgit v1.3