We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f6a8e28 commit 808db93Copy full SHA for 808db93
src/zig_writer.zig
@@ -57,7 +57,14 @@ pub fn ZigWriter(comptime Writer: type) type {
57
const arg = @field(args, arg_fields[current_arg].name);
58
const arg_type_info = @typeInfo(@TypeOf(arg));
59
if (arg_type_info == .Pointer and arg_type_info.Pointer.size == .Slice and arg_type_info.Pointer.child == u8) {
60
- try w.out.print("{s}", .{arg});
+ for (arg) |char| {
61
+ switch (char) {
62
+ // Zig is very tab-hostile, so we have to replace tabs with spaces.
63
+ // This is most relevant when translating documentation.
64
+ '\t' => try w.out.writeAll(" "),
65
+ else => try w.out.writeByte(char),
66
+ }
67
68
} else {
69
try w.out.print("{}", .{arg});
70
}
0 commit comments