<html><head><title>clang-format "ContinuationIndentWidth: 3" format style not working?</title>
</head>
<body>
<span style=" font-family:'Courier New'; font-size: 12pt;">Hello,<br>
<br>
I am currently using the following format style options with clang-format v6.0.0:<br>
<br>
---<br>
Language: Cpp<br>
TabWidth: 3<br>
IndentWidth: 3<br>
ContinuationIndentWidth: 3<br>
IndentCaseLabels: false<br>
BreakBeforeBraces: Custom<br>
BraceWrapping:<br>
AfterClass: true<br>
AfterControlStatement: true<br>
AfterEnum: true<br>
AfterFunction: true<br>
AfterNamespace: true<br>
AfterStruct: true<br>
AfterUnion: true<br>
AfterExternBlock: true<br>
BeforeCatch: true<br>
BeforeElse: true<br>
...<br>
<br>
<br>
Here a snippet of my original code, which uses 3-space indents and doesn't look to me like it should be changed at all by clang-format:<br>
<br>
for (bin = hashTable->firstBin; bin < end; ++bin)<br>
{<br>
printf("%d entries for bin %d:\n",<br>
(int)bin->nodes, (int)(bin - hashTable->firstBin));<br>
<br>
PrintTree(bin->firstNode);<br>
}<br>
<br>
However, clang-format changes the continuation line of printf as shown below. Note that it is now indented by 7 spaces from the printf instead of the 3 spaces I would expect. In addition, obviously 7 isn't even an integral multiple of 3. Is there something additional I should specify to correct this?<br>
<br>
for (bin = hashTable->firstBin; bin < end; ++bin)<br>
{<br>
printf("%d entries for bin %d:\n",<br>
(int)bin->nodes, (int)(bin - hashTable->firstBin));<br>
<br>
PrintTree(bin->firstNode);<br>
}<br>
<br>
Thanks,<br>
Ray<br>
<br>
</body></html>