[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 8 18:47:14 PST 2025
================
@@ -660,17 +672,18 @@ class LineJoiner {
assert(Limit >= L1.Last->TotalLength + 3);
const auto InnerLimit = Limit - L1.Last->TotalLength - 3;
- const auto MergedLines = tryMergeNamespace(I + 1, E, InnerLimit);
+ const auto MergedLines =
+ tryMergeNamespace(BraceOpenLine + 1, E, InnerLimit, OpenBraceWrapped);
if (MergedLines == 0)
return 0;
- const auto N = MergedLines + 2;
+ const auto N = MergedLines + 2 + OpeningBraceLineOffset;
----------------
owenca wrote:
```suggestion
const auto N = MergedLines + LinesToBeMerged;
```
https://github.com/llvm/llvm-project/pull/123010
More information about the cfe-commits
mailing list