fix(style): render only necessary bytes and change default fg color to .default
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 45s
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 45s
This commit is contained in:
@@ -34,7 +34,7 @@ pub const Emphasis = enum(u8) {
|
||||
strikethrough,
|
||||
};
|
||||
|
||||
fg: Color = .white,
|
||||
fg: Color = .default,
|
||||
bg: Color = .default,
|
||||
ul: Color = .default,
|
||||
ul_style: Underline = .off,
|
||||
@@ -63,7 +63,7 @@ pub fn value(this: Style, writer: anytype, cp: u21) !void {
|
||||
for (this.emphasis) |attribute| try std.fmt.format(writer, ";{d}", .{@intFromEnum(attribute)});
|
||||
try std.fmt.format(writer, "m", .{});
|
||||
// content
|
||||
try std.fmt.format(writer, "{s}", .{buffer});
|
||||
try std.fmt.format(writer, "{s}", .{buffer[0..bytes]});
|
||||
try std.fmt.format(writer, "\x1b[0m", .{});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user