Commit 3845c264a6

Andrew Kelley <andrew@ziglang.org>
2021-05-21 00:20:27
stage2: fix compile error rendering for hard tabs
render them as 1 space instead. This fixes the column caret.
1 parent 34d0542
Changed files (1)
src/Compilation.zig
@@ -354,7 +354,10 @@ pub const AllErrors = struct {
                     try stderr.print(" {s}\n", .{src.msg});
                     ttyconf.setColor(stderr, .Reset);
                     if (src.source_line) |line| {
-                        try stderr.writeAll(line);
+                        for (line) |b| switch (b) {
+                            '\t' => try stderr.writeByte(' '),
+                            else => try stderr.writeByte(b),
+                        };
                         try stderr.writeByte('\n');
                         try stderr.writeByteNTimes(' ', src.column);
                         ttyconf.setColor(stderr, .Green);