llvm-project
301c651c - [clang-format] Fix single-line enum wrapping with ColumnLimit: 0 (#240043)

Commit
1 day ago
[clang-format] Fix single-line enum wrapping with ColumnLimit: 0 (#240043) Fixes #239166 When ColumnLimit is 0 and AllowShortEnumsOnASingleLine is true, ContinuationIndenter::moveStateToNewBlock unconditionally set BreakBeforeParameter to true upon entering the enum block. Because startsNextParameter() returns true after each enumerator comma, mustBreak() forced each enumerator after the first onto a separate line. Set BreakBeforeParameter to false for TT_EnumLBrace when ColumnLimit is 0 and AllowShortEnumsOnASingleLine is true, preserving single-line enums. Fixes #239166 Tool disclosure: The patch and unit tests were authored manually; Google Antigravity was used to review the diff, run local tests, and write this commit message.
Author
Parents
Loading