From 3845c264a6880a810a381ab4f7d0c03514350200 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 20 May 2021 15:20:27 -0700 Subject: [PATCH] stage2: fix compile error rendering for hard tabs render them as 1 space instead. This fixes the column caret. --- src/Compilation.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Compilation.zig b/src/Compilation.zig index ff36df198a..f3059a25a5 100644 --- a/src/Compilation.zig +++ b/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);