c: Fix incorrect indentation after `if` statements
- Closes #13924
Release Notes:
- curly braces won't indent after If, else if, else
We require contributors to sign our Contributor License Agreement, and we don't have @Louis-Ladd on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.
@cla-bot check
The cla-bot has been summoned, and re-checked this pull request!
This PR fails the test_c_autoindent
if ()
{
}
if () {
}
Running the build myself and testing both styles correctly indents for me so I'm not sure why it's failing that test.
The issue is that whilst your described cases now work properly, the case originally causing this behavior stopped working with your changes.
This is the case
if ()
single_statement_to_be_executed
which is an if-statement with just a single statement and without brackets.
The removal of this auto-indentation is also what fails the tests. The issue you referenced also stated that the indentation should only be removed once brackets are inserted.
Looks quite stale, so will close this.