commit 094e841f09feebaf28a269650b053e0639783440 (tree)
parent 7ec2f2b27d72c46b6d2e0b68f8f91aaf61c2263e
Author: Mason Remaley <mason@gamesbymason.com>
Date: Tue, 7 Apr 2026 16:01:14 -0700
Don't print column if column info is missing
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
@@ -1178,7 +1178,11 @@ fn printLineInfo(
t.setColor(.bold) catch {};
if (source_location) |*sl| {
- try writer.print("{s}:{d}:{d}", .{ sl.file_name, sl.line, sl.column });
+ if (sl.column == 0) {
+ try writer.print("{s}:{d}", .{ sl.file_name, sl.line });
+ } else {
+ try writer.print("{s}:{d}:{d}", .{ sl.file_name, sl.line, sl.column });
+ }
} else {
try writer.writeAll("???:?:?");
}