Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-format] Improve BAS_DontAlign+AllowAllArgumentsOnNextLine=false
TokenAnnotator::splitPenalty() was always returning 0 for opening parens if AlignAfterOpenBracket was set to BAS_DontAlign, so the preferred point for line breaking was always after the open paren (and was ignoring PenaltyBreakBeforeFirstCallParameter). This change restricts the zero penalty to the AllowAllArgumentsOnNextLine case. This results in improved formatting for FreeBSD where we set AllowAllArgumentsOnNextLine: false and a high value for PenaltyBreakBeforeFirstCallParameter to avoid breaking after the open paren. Before: ``` functionCall( paramA, paramB, paramC); void functionDecl( int A, int B, int C) ``` After: ``` functionCall(paramA, paramB, paramC); void functionDecl(int A, int B, int C) ``` Reviewed By: MyDeveloperDay Differential Revision: https://reviews.llvm.org/D90246
- Loading branch information
1 parent
5bc438e
commit 906b9db
Showing
2 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters