-
Notifications
You must be signed in to change notification settings - Fork 13.5k
clang-format with BlockIndent and ContinuationIndentWidth < 4 not working for if statements #80123
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
Labels
Comments
Related to #79176 which aims for the same formatting, while describing current behavior for ContinuationIndentWidth = 4. |
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
Sep 23, 2024
Introduce new options to allow for control of AlwaysBreak and BlockIndent selectively for If conditional statements (as currently supported), other conditional statements (for/while/switch), and other statements. Fixes llvm#67738. Fixes llvm#79176. Fixes llvm#80123.
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
Oct 18, 2024
Introduce new options to allow for control of AlwaysBreak and BlockIndent selectively for If conditional statements (as currently supported), other conditional statements (for/while/switch), and other statements. Fixes llvm#67738. Fixes llvm#79176. Fixes llvm#80123.
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
Dec 2, 2024
Introduce new options to allow for control of AlwaysBreak and BlockIndent selectively for If conditional statements (as currently supported), other conditional statements (for/while/switch), and other statements. Fixes llvm#67738. Fixes llvm#79176. Fixes llvm#80123.
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
Jan 28, 2025
Introduce new options to allow for control of AlwaysBreak and BlockIndent selectively for If conditional statements (as currently supported), other conditional statements (for/while/switch), and other statements. Fixes llvm#67738. Fixes llvm#79176. Fixes llvm#80123.
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
Jan 29, 2025
Introduce new options to allow for control of AlwaysBreak and BlockIndent selectively for If conditional statements (as currently supported), other conditional statements (for/while/switch), and other statements. Fixes llvm#67738. Fixes llvm#79176. Fixes llvm#80123.
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
Feb 9, 2025
Introduce new options to allow for control of AlwaysBreak and BlockIndent selectively for If conditional statements (as currently supported), other conditional statements (for/while/switch), and other statements. Fixes llvm#67738. Fixes llvm#79176. Fixes llvm#80123.
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
Apr 30, 2025
Introduce new style option to allow overriding the breaking after the opening parenthesis for control statements (if/for/while/switch). Fixes llvm#67738. Fixes llvm#79176. Fixes llvm#80123.
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
May 1, 2025
Introduce new style option to allow overriding the breaking after the opening parenthesis for control statements (if/for/while/switch). Fixes llvm#67738. Fixes llvm#79176. Fixes llvm#80123.
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
May 12, 2025
Introduce new options to allow for control of AlwaysBreak and BlockIndent selectively for If conditional statements (as currently supported), other conditional statements (for/while/switch), and other statements. Fixes llvm#67738. Fixes llvm#79176. Fixes llvm#80123.
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
May 22, 2025
Introduce new style option to allow overriding the breaking after the opening parenthesis for control statements (if/for/while/switch). Fixes llvm#67738. Fixes llvm#79176. Fixes llvm#80123.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
When using clang-format v18.0 with the following minimum config:
Breaking if-statements which are longer than the column limit won't work. I found out, that
BlockIndent
seems to be broken for if-statements whenContinuationIndentWidth < 4
.Seems to be (slightly) related to: #28052
Input
And I try to format the following if statement:
Current output
clang-format correctly formats everything except for breaking the if statement with
BlockIndent
:Expected output:
Comment: I don't mind where the
||
operators go, even though I'd prefer the math-style of breaking before it.Any way to achieve this?
The text was updated successfully, but these errors were encountered: