From 2586e804e4df670bf6a5072ec776d9fc00c1c4b9 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 22:57:53 -0300 Subject: 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 --- src/tagline.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/tagline.zig') diff --git a/src/tagline.zig b/src/tagline.zig index 68fa2645..d024be4e 100644 --- a/src/tagline.zig +++ b/src/tagline.zig @@ -286,10 +286,12 @@ pub fn wrapTag(arena: std.mem.Allocator, whole: []const u8, width: usize) !Shown return .{ .text = out.items, .soft = soft.items }; } -/// The tag's width for wrapping: its columns, one kept for the caret past -/// a full row's end. +/// The tag's width for wrapping: all its columns. A row the text fills +/// exactly stays one row, as acme's frame wraps a box only when it is wider +/// than what is left (libframe frutil.c _frcklinewrap), and the caret past +/// its end sits at the edge (frptofchar.c clamps it to r.max.x). pub fn tagWidth(p: *const Pardes, id: usize) usize { - return @max(1, @as(usize, p.tagCapacity(p.rects[id].w -| TAG_TEXT_INSET)) -| 1); + return @max(1, @as(usize, p.tagCapacity(p.rects[id].w -| TAG_TEXT_INSET))); } pub fn shownTag(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) !Shown { -- cgit v1.3