From 232bfbbc4371a1fe9df210874118b4450dce7f9d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 00:30:46 -0300 Subject: Let a pane's tag take a row for each line it holds A tag that is a text can hold a newline, and the tagline, the body under it and the pointer all assumed one row. The pane's tag now takes a row per line (up to eight, and never the body's last row); the body starts below it, the rows a pointer counts start the body after the tag's lines, a click on any line puts the tag's cursor there, and a pixel shell gets a tag layer per line. A tag of one line draws exactly as before. Co-Authored-By: Claude Opus 5.5 --- src/panes.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/panes.zig') diff --git a/src/panes.zig b/src/panes.zig index 720f655f..6887008c 100644 --- a/src/panes.zig +++ b/src/panes.zig @@ -25,7 +25,7 @@ pub const EditText = struct { text: []u8, row0: i32 }; pub const Pane = struct { /// One mouse selection (block-shaped), per button. c/r are text-area relative; - /// r counts from the tag row (body starts at BOX_H). + /// r counts from the tag's first row (the body starts at Pane.tag_rows). pub const Sel = struct { state: enum { none, dragging, done } = .none, source_id: u64 = 0, @@ -121,6 +121,10 @@ pub const Pane = struct { focus: Focus = .body, /// Display columns hidden to reveal the tag caret; tag addresses stay whole. tag_scroll: u16 = 0, + /// Rows the tag takes on screen: one per line of it, as many as the pane + /// 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, cwd: Cwd = .none, hscroll: i32 = 0, // Visible rows map to source lines and raw/display column origins. -- cgit v1.3