mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
zig fmt: call ais.resetLine after "zig fmt: on"
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user