You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a bug, zig fmt has special rules for array inits and tries to format them like tables. What you end up with in your repro is a table with 7 columns and 1 row. But if you for example instead first manually format your code like this
However, it should be noted that this special handling is a little awkward and is the reason that // zig fmt: off does not work in array inits. It has been suggested that this special handling should be removed in favor of manual alignment with // zig fmt: off (#10418 (comment)), or expanded upon as part of #17145.
Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
Expected Behavior
On format the list of arguments should be aligned vertically because of the trailing comma but instead it all stays on one line.
Unless this is a peculiar corner-case of more-than-one-item-per-line formatting, it seems a bug.
Removing the comma, formatting, and then adding it back restored the expected behavior (because the first save changes the location of
}),
.The text was updated successfully, but these errors were encountered: