Skip to content

'zig fmt: on' directive not working inside array declaration #10418

@LewisGaul

Description

@LewisGaul

Zig Version

0.10.0-dev.63+6b8e33d14

Steps to Reproduce

const a = .{
    // zig fmt: off
    .{ 0,      1    },
    // zig fmt: on
};

// No formatting here...
const b =   2;
test {
    _ =      1;
}

// This fixes it:
// zig fmt: on
const c = 3;

Expected Behavior

Expected // zig fmt: on to re-enable formatting

Actual Behavior

The zig fmt: on directive seems to be ignored inside a static struct/array declaration, even when zig fmt: off took effect inside it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorzig fmt

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions