From 8429e7bd8aff1ae0c71d3b1a7a6b9f01ed52e691 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 19:17:12 -0300 Subject: Column and workspace tags are one line again, as acme's acme gives a column tag one font height (cols.c:244) and its row tag one line; pardes let them grow a row per line. A newline typed, pasted, written or restored into a column or workspace tag now becomes a space, the caret and selection kept on the same characters, and the bars are one row each. A dump holding a multi-line header tag comes back with its lines joined by spaces. Co-Authored-By: Claude Opus 5.5 --- test/panes.zig | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/panes.zig b/test/panes.zig index 96819728..233e7627 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -267,22 +267,14 @@ test "a tag with more lines than rows scrolls to keep its caret in view" { try std.testing.expectEqual(tag_y, top.cursor.?.y); try std.testing.expectEqualStrings("/", top.at(x, tag_y).grapheme()); - // A column tag does the same in its rows. + // A column tag is one row, as acme's: its lines are joined. many.clearRetainingCapacity(); try many.appendSlice(std.testing.allocator, "New"); for (1..21) |n| try many.print(std.testing.allocator, "\nC{d}", .{n}); p.col_tags[0].own = try p.gpa.dupe(u8, many.items); p.update(.tick); - const rows = p.columnBarHeight(); - try std.testing.expectEqual(@as(u16, pardes.MAX_TAG_ROWS), rows); - pardes.tagline.enterHeader(p, 0); - p.update(.{ .key = .{ .cp = 'g' } }); - p.update(.{ .key = .{ .cp = 'e' } }); - const header = try p.render(frame.allocator()); - const header_row = p.topBarHeight() + rows - 1; - try std.testing.expectEqual(header_row, header.cursor.?.y); - try std.testing.expectEqualStrings("C", header.at(p.col_x[0] + pardes.TAG_TEXT_INSET, header_row).grapheme()); - try std.testing.expectEqualStrings("2", header.at(p.col_x[0] + pardes.TAG_TEXT_INSET + 1, header_row).grapheme()); + try std.testing.expectEqual(pardes.COLBAR_H, p.columnBarHeight()); + try std.testing.expect(std.mem.indexOfScalar(u8, p.col_tags[0].own.?, '\n') == null); } const TagNavigationTests = struct { -- cgit v1.3