summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 19:17:12 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit8429e7bd8aff1ae0c71d3b1a7a6b9f01ed52e691 (patch)
tree9ae9dbe35e371a7b64b7e64bd690c4871e0b705c /test
parent4cea4751960b359561997cb040f05179923cb80e (diff)
downloadpardes-8429e7bd8aff1ae0c71d3b1a7a6b9f01ed52e691.tar.gz
pardes-8429e7bd8aff1ae0c71d3b1a7a6b9f01ed52e691.zip
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 <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/panes.zig14
1 files changed, 3 insertions, 11 deletions
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 {