Fix enum constants wrapping

This commit is contained in:
Laurent Tréguier 2018-10-07 14:41:21 +02:00
parent 0ac3f1b291
commit d30208ee1f
No known key found for this signature in database
GPG Key ID: 09530BFFC32D4A69
3 changed files with 8 additions and 6 deletions

View File

@ -1314,7 +1314,8 @@ private:
{
if (isWrapToken)
{
pushWrapIndent();
if (!indents.topIs(tok!"enum"))
pushWrapIndent();
write(" ");
writeToken();
newline();
@ -1331,7 +1332,8 @@ private:
{
if (isWrapToken)
{
pushWrapIndent();
if (!indents.topIs(tok!"enum"))
pushWrapIndent();
newline();
writeToken();
}

View File

@ -2,14 +2,14 @@ void foo()
{
if (true)
enum vectorizeable = aLongExpressionThatCausesWrapping()
&& aLongExpressionThatCausesWrapping();
&& aLongExpressionThatCausesWrapping();
else
enum vectorizeable = false;
if (true)
{
enum vectorizeable = aLongExpressionThatCausesWrapping()
&& aLongExpressionThatCausesWrapping();
&& aLongExpressionThatCausesWrapping();
}
else
enum vectorizeable = false;

View File

@ -1,13 +1,13 @@
void foo() {
if (true)
enum vectorizeable = aLongExpressionThatCausesWrapping()
&& aLongExpressionThatCausesWrapping();
&& aLongExpressionThatCausesWrapping();
else
enum vectorizeable = false;
if (true) {
enum vectorizeable = aLongExpressionThatCausesWrapping()
&& aLongExpressionThatCausesWrapping();
&& aLongExpressionThatCausesWrapping();
} else
enum vectorizeable = false;
}