From 5034d72247704691d0d2bea33ac95936ad8a6d28 Mon Sep 17 00:00:00 2001 From: Joseph Cochran Date: Wed, 11 Feb 2026 20:59:47 -0500 Subject: [PATCH 1/2] Add paren around struct literal --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ac2a3b..0490ee4 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ const Model = struct { } pub fn view(self: *const Model, ctx: *const zz.Context) []const u8 { - const style = zz.Style{}.bold(true).fg(zz.Color.cyan()); + const style = (zz.Style{}).bold(true).fg(zz.Color.cyan()); const text = std.fmt.allocPrint(ctx.allocator, "Count: {d}\n\nPress q to quit", .{self.count}) catch "Error"; return style.render(ctx.allocator, text) catch text; } From 238215a76da6e1aa189c5a19f66bea6348a05c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20M=C3=A9sz=C3=A1ros=20=28Laptop=29?= Date: Thu, 12 Feb 2026 04:43:37 +0100 Subject: [PATCH 2/2] Fix remaining struct literal chaining in README examples --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0490ee4..8fcd86f 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ return .{ .println = "Log message" }; // Print above the program output The styling system is inspired by Lipgloss: ```zig -const style = zz.Style{} +const style = (zz.Style{}) .bold(true) .italic(true) .fg(zz.Color.cyan()) @@ -149,11 +149,11 @@ const style = zz.Style{} const output = try style.render(allocator, "Hello, World!"); // Text transforms -const upper_style = zz.Style{}.transform(zz.transforms.uppercase); +const upper_style = (zz.Style{}).transform(zz.transforms.uppercase); const shouting = try upper_style.render(allocator, "hello"); // "HELLO" // Whitespace formatting controls -const ws_style = zz.Style{} +const ws_style = (zz.Style{}) .underline(true) .setUnderlineSpaces(true) // Underline extends through spaces .setColorWhitespace(false); // Don't apply bg color to whitespace @@ -162,11 +162,11 @@ const ws_style = zz.Style{} const derived = style.unsetBold().unsetPadding().unsetBorder(); // Style inheritance (unset values inherit from parent) -const child = zz.Style{}.fg(zz.Color.red()).inherit(style); +const child = (zz.Style{}).fg(zz.Color.red()).inherit(style); // Style ranges - apply different styles to byte ranges const ranges = &[_]zz.StyleRange{ - .{ .start = 0, .end = 5, .s = zz.Style{}.bold(true) }, + .{ .start = 0, .end = 5, .s = (zz.Style{}).bold(true) }, }; const ranged = try zz.renderWithRanges(allocator, "Hello World", ranges);