diff options
author | Owen Pan <owenpiano@gmail.com> | 2024-12-18 12:42:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-18 12:42:26 -0800 |
commit | f03bf8c45f430c4fbf9f3a60c67bf2e69459d7a5 (patch) | |
tree | a3d4d659d815e4bb1a029c9d7257f99d03ad3aab /clang/lib/Format/ContinuationIndenter.cpp | |
parent | 9b3d85f0f43a9337223f8d69bbe71d5b4f41fd33 (diff) | |
download | llvm-f03bf8c45f430c4fbf9f3a60c67bf2e69459d7a5.zip llvm-f03bf8c45f430c4fbf9f3a60c67bf2e69459d7a5.tar.gz llvm-f03bf8c45f430c4fbf9f3a60c67bf2e69459d7a5.tar.bz2 |
[clang-format] Don't change breaking before CtorInitializerColon (#119522)
Don't change breaking before CtorInitializerColon with `ColumnLimit: 0`.
Fixes #119519.
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 9ffdc04..554b55f 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -461,9 +461,8 @@ bool ContinuationIndenter::mustBreak(const LineState &State) { getColumnLimit(State) || CurrentState.BreakBeforeParameter) && (!Current.isTrailingComment() || Current.NewlinesBefore > 0) && - (Style.AllowShortFunctionsOnASingleLine != FormatStyle::SFS_All || - Style.BreakConstructorInitializers != FormatStyle::BCIS_BeforeColon || - Style.ColumnLimit != 0)) { + (Style.BreakConstructorInitializers != FormatStyle::BCIS_BeforeColon || + Style.ColumnLimit > 0 || Current.NewlinesBefore > 0)) { return true; } |