File tree Expand file tree Collapse file tree 3 files changed +34
-5
lines changed
Expand file tree Collapse file tree 3 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -307,10 +307,11 @@ private:
307307 else if ((isBlockHeader() || currentIs(tok! " version" ) || currentIs(tok! " debug" ))
308308 && peekIs(tok! " (" , false ))
309309 {
310- immutable bool shouldPushIndent = (! currentIs(tok! " version" )
311- && ! currentIs(tok! " debug" )) || astInformation.conditionalWithElseLocations
312- .canFindIndex(current.index) || astInformation.conditionalStatementLocations.canFindIndex(
313- current.index);
310+ immutable bool a = ! currentIs(tok! " version" ) && ! currentIs(tok! " debug" ) ;
311+ immutable bool b = a || astInformation.conditionalWithElseLocations
312+ .canFindIndex(current.index);
313+ immutable bool shouldPushIndent = b || astInformation.conditionalStatementLocations
314+ .canFindIndex(current.index);
314315 if (shouldPushIndent)
315316 indents.push(current.type);
316317 writeToken();
@@ -1764,7 +1765,7 @@ struct IndentStack
17641765 foreach (i; 1 .. j + 1 )
17651766 {
17661767 if ((i + 1 <= index && ! isWrapIndent(arr[i]) && isTempIndent(arr[i])
1767- && (! isTempIndent(arr[i + 1 ]))))
1768+ && (! isTempIndent(arr[i + 1 ]) || arr[i + 1 ] == tok ! " switch " )))
17681769 {
17691770 continue ;
17701771 }
Original file line number Diff line number Diff line change 1+ unittest
2+ {
3+ loop: while (i < tokens.length) switch (tokens[i].type)
4+ {
5+ case tok! " (" :
6+ parenDepth++ ;
7+ i++ ;
8+ break ;
9+ case tok! " {" :
10+ braceDepth++ ;
11+ i++ ;
12+ break ;
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ unittest
2+ {
3+ loop: while (i < tokens.length) switch (tokens[i].type)
4+ {
5+ case tok!"(":
6+ parenDepth++;
7+ i++;
8+ break;
9+ case tok!"{":
10+ braceDepth++;
11+ i++;
12+ break;
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments