<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/135269>135269</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format: better continuation indent options for BraceWrapping=false
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
belm0
</td>
</tr>
</table>
<pre>
With `BraceWrapping` set to false, readability is impacted when the opening of a code block includes continuation indents, causing the continued lines and the first line of the body to have the same indent level:
```C++
Foo::Bar::Result<Foo::Bar::Type1, Foo::Bar::Type2> exampleFunction(
const SomeType& arg1, const AnotherType& arg2) {
auto variable = someValue;
...
```
I'd like the continuations to be double-indented, but `ContinuationIndentWidth` is coarse and applies to too may cases where I don't want additional indent (function calls, etc.).
So perhaps add an option like UnwrappedBraceContinuationIndent that will apply to continued lines prior to an unwrapped brace.
```C++
// with UnwrappedBraceContinuationIndent: 8
Foo::Bar::Result<Foo::Bar::Type1, Foo::Bar::Type2> exampleFunction(
const SomeType& arg1, const AnotherType& arg2) {
auto variable = someValue;
auto another_var = very_long_function_call(const Baz& arg1, const Baz& arg2,
const Baz& arg3); // NOTE: regular continuation indent
...
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8VF1r7DYQ_TXyyxDjyN4PP_hhd3MX8tJC723zGMbWrK1eWTKSvNvtry8jb0jaJLRQuCCwmRkdnTlzJAxB95aoEau9WD1kOMfB-aYlMxZZ69S1edJxALEu9h47evI4Tdr2Yl1AoAjRwQlNICEP4AkVttroeAUdQI8TdpEUXAayEAcCN5HVtgd3AoTOKYLWuO47aNuZWVGAztmo7YxROwvaKrIxMHKHc-CNDHKrIQVGWwqAVqX4SfsQU4zxOcLsmeCAZ0qBgCPdYMHQmYwod6JIa10s6yDknlexOzrH6XK3R7_8_EJhNlGUh_epb9eJ7pnpxykpyi9Af-A4GTrOtuP-hNyKYgcA3FGI8NWNxLVCrgF9n9CWzM66OJB_k5RC1iA2TBNwjg7O6DW2hkCUDxDcSL-hmUmU-9sReZ6_7XJp-lHIDav4nd4Km8QPrFtLoNzcGrpbNCPFnNo5shsOb6ofU_pJqziwLzQPEn2gNBucJqMpAUbnYMQrdBgosC08wSMo1mIT4YI2AiqlGRLNy6CE3J5ukkGHxiRDUOxyIet8aeSrg4n8gFPg_YAW3JTqU2-_2gubllQy8HveEAeMcNHGJK7JMv802eS185xAC_MLHrQMmH_qICGPQh7hwvfn30iIcgfbBenHGe__mw_gv_kvFeEC9XxGn-rO5K_Pxtn--WXAzzxgIbfL0Xv88z2f16AU8vCukdd0KWQtyj0A3Obw08_fvrDMnvrZoP_osfn0tmSqKVVd1phRc7-pqlLKuqqyoVnjqlU11rRpt63CdVVVXUXlqlAtFVuqMt3IQq6K6r6QsqiLKidJVK1pu5LbWm5WnagKGlGb3JjzmDvfZzqEmZr7ciXXdWawJRNeXmffcNVdO_dBVIXRIYbXfVFHQ01n0PZ3J-dHTK5qKUb6sNvbLQlwch7-_rqXD-lVz2ZvmiHGKbClkoy9jsPc5p0bhTzy0bfP3eTd79RFIY-JfxDyeGvh3Mi_AgAA__-YzQ4e">