zig fmt: call ais.resetLine after "zig fmt: on"

This commit is contained in:
Kendall Condon
2026-03-22 17:29:03 -04:00
parent d70a9ea5d7
commit ed3ca0f570
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -3326,6 +3326,7 @@ fn renderComments(r: *Render, start: usize, end: usize) Error!bool {
// Write with the canonical single space.
try ais.underlying_writer.writeAll("// zig fmt: on\n");
ais.disabled_offset = null;
ais.resetLine();
} else if (ais.disabled_offset == null and mem.eql(u8, comment_content, "zig fmt: off")) {
// Write with the canonical single space.
try ais.writeAll("// zig fmt: off\n");
+10
View File
@@ -6871,6 +6871,16 @@ test "zig fmt: nested asm indentation" {
);
}
test "zig fmt: asm with zig fmt on" {
try testCanonical(
\\// zig fmt: off
\\const A = asm("a" // zig fmt: on
\\ : [_] "" (_),
\\);
\\
);
}
test "recovery: top level" {
try testError(
\\test "" {inline}