Skip to content
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

Fix objc colon getting extra spaces after ternary #4311

Merged
merged 6 commits into from
Jun 4, 2024

Conversation

PoeticPete
Copy link
Contributor

(Please review #4307 first. That will eliminate most of the changes in this stacked PR.)

Fixes #4309

The following gets incorrectly formatted

static void func() {
    true ? [Foo test:@""] : @"bar";
}
static void func() {
    true ? [Foo test : @""] : @"bar";
}

cfg

sp_cond_colon                   = force
align_oc_msg_colon_span         = 1
indent_columns                  = 4
indent_with_tabs                = 0
indent_ternary_operator         = 2

This PR fixes the extra spaces added around the objc colon by preventing colons inside brackets from getting labeled as COND_COLON.

@gmaurel gmaurel merged commit 9d62139 into uncrustify:master Jun 4, 2024
3 checks passed
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.

bad ternary format in objc
2 participants