A pretty printer for zig
zig

expose innerFmt via runtime

altagos.dev da8f80cb eebc4326

verified
+10 -1
+10 -1
pretty.zig
··· 142 142 .no_color = options.no_color, 143 143 }; 144 144 145 - return innerFmt(T, ctx, &run, this.value, .{}); 145 + return run.pretty(ctx, this.value, .{}); 146 146 } 147 147 }; 148 148 } ··· 163 163 164 164 pub inline fn write(this: *const Runtime, text: []const u8) error{WriteFailed}!void { 165 165 _ = try this.out.write(text); 166 + } 167 + 168 + pub fn pretty( 169 + this: *const Runtime, 170 + comptime ctx: Context, 171 + value: anytype, 172 + comptime opts: InnerFmtOptions, 173 + ) error{WriteFailed}!void { 174 + return innerFmt(@TypeOf(value), ctx, this, value, opts); 166 175 } 167 176 168 177 pub inline fn setColor(