authorgravatar for goon.pri.low@gmail.comKendall Condon <goon.pri.low@gmail.com> 2026-03-22 17:29:03-04:00
committergravatar for goon.pri.low@gmail.comKendall Condon <goon.pri.low@gmail.com> 2026-03-25 17:30:51-04:00
loged3ca0f570e052adbed291a79e9a11bba5d3f7d0
tree0fad76049a43ddc2936c88198b80e57b230941ef
parentd70a9ea5d759fd5e61c8cd7404343c34280fe87e

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


2 files changed, 11 insertions(+), 0 deletions(-)

lib/std/zig/Ast/Render.zig+1
......@@ -3326,6 +3326,7 @@ fn renderComments(r: *Render, start: usize, end: usize) Error!bool {
33263326 // Write with the canonical single space.
33273327 try ais.underlying_writer.writeAll("// zig fmt: on\n");
33283328 ais.disabled_offset = null;
3329 ais.resetLine();
33293330 } else if (ais.disabled_offset == null and mem.eql(u8, comment_content, "zig fmt: off")) {
33303331 // Write with the canonical single space.
33313332 try ais.writeAll("// zig fmt: off\n");
lib/std/zig/parser_test.zig+10
......@@ -6871,6 +6871,16 @@ test "zig fmt: nested asm indentation" {
68716871 );
68726872}
68736873
6874test "zig fmt: asm with zig fmt on" {
6875 try testCanonical(
6876 \\// zig fmt: off
6877 \\const A = asm("a" // zig fmt: on
6878 \\ : [_] "" (_),
6879 \\);
6880 \\
6881 );
6882}
6883
68746884test "recovery: top level" {
68756885 try testError(
68766886 \\test "" {inline}