summaryrefslogtreecommitdiff
path: root/src/draw.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 22:57:53 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit2586e804e4df670bf6a5072ec776d9fc00c1c4b9 (patch)
tree8b5b5369e8a8653b1dd2ac4952a152f4afeec830 /src/draw.zig
parent692ea930553e375bdbac874da93893b02b8725b3 (diff)
downloadpardes-2586e804e4df670bf6a5072ec776d9fc00c1c4b9.tar.gz
pardes-2586e804e4df670bf6a5072ec776d9fc00c1c4b9.zip
A tag that exactly fills its row stays one row, as acme's does
Tags wrapped one cell early to keep a cell for the caret past a full row, so a tag that exactly filled its column broke as De / l. acme's frame wraps a box only when it is wider than what the row has left, and frptofchar clamps the tick past a full line's end to the frame's edge. Tags now wrap at their full width; the caret past a full row sits at the tag layer's edge, and on the pane's last cell in a terminal grid, which has none past it. Two tiny-screen tests collapse their tags, as the others do, and the 41 goldens that moved were re-recorded by name after the same check: rows shift back up under the shorter tags and nothing else changes. chordcut's file-body clicks moved back with them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/draw.zig')
-rw-r--r--src/draw.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/draw.zig b/src/draw.zig
index 963d61c1..fb770b60 100644
--- a/src/draw.zig
+++ b/src/draw.zig
@@ -987,9 +987,11 @@ fn joinPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r
// The grid's row: the gap cell and the text, as far as the pane.
joinCells(s, region.rect.x, region.rect.y + @as(u16, @intCast(line)), storage[line * pitch ..][0..pitch], config.GUTTER, region.rect.w, tag_fg);
}
- if (temporary.cursor) |cursor| if (cursor.x - TAG_TEXT_INSET < r.w - TAG_TEXT_INSET) {
- s.cursor = .{ .x = r.x + cursor.x, .y = region.rect.y + cursor.y, .bar = cursor.bar };
- };
+ // Past a full row's end the layer's caret is at the tag's edge, as
+ // acme's tick is; the grid has no cell there, so it takes the last one.
+ if (temporary.cursor) |cursor| {
+ s.cursor = .{ .x = r.x + @min(cursor.x, r.w - 1), .y = region.rect.y + cursor.y, .bar = cursor.bar };
+ }
}
/// A notice chip, painted once as a tag layer at the tagline's pitch, and the