Skip to content

bugfix 23071: zig fmt: (off|on) is not maintained across nested containers #23523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

kj4tmp
Copy link
Contributor

@kj4tmp kj4tmp commented Apr 10, 2025

Intended to close #23071

This PR is a draft.

Currently I have added a test that reproduces the issue.

My notes:

I have isolated this bug to /lib/std/zig/render.zig.

The problem is that there are multiple nested AutoIndentingStream created when there are nested containers, and a nested AutoIndentingStream is not respecting the disabled_offset of its parent. (See multiple call sites of Ais.init()). On Ais.init(), the nested stream is initialized into the enabled state, regardless of the state of the parent.

@kj4tmp kj4tmp closed this Apr 17, 2025
@kj4tmp
Copy link
Contributor Author

kj4tmp commented Apr 17, 2025

Likely requires a re-write of renderArrayInit, going to take a while

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zig fmt bugs with nested containers
1 participant