-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Do you think it would make sense to include a format function, so that Styles can be printed directly?
I added this,
pub fn format(value: Self, comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) std.os.WriteError!void {
try @import("format.zig").updateStyle(writer, value, null);
}
while porting a program away from a different lib, where I had added something similar, and it made the port easy, if suboptimal.
And another thing, when you don't want the cursor to be misplaced, you need yet more escape codes around the bytes that aren't displayed. Currently I have a wrapping writer that adds them as neccessary, but maybe that should be part of the lib in some way?
Would be happy to send patches for those things.
Metadata
Metadata
Assignees
Labels
No labels