Skip to content

Commit

Permalink
Fix indentation of 'else if'
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Jan 11, 2016
1 parent 8a9a731 commit 929a9d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -888,22 +888,22 @@ void MethodName()
}
else if (2 == 3)
{
int y = 3 + 2;
int y = 3 + 2;
}
else
{
int y = 3 + 2;
int y = 3 + 2;
}
if (1 == 2)
return;
else if (2 == 3)
{
int y = 3 + 2;
int y = 3 + 2;
}
else
{
int y = 3 + 2;
int y = 3 + 2;
}
if (1 == 2)
Expand All @@ -914,7 +914,7 @@ void MethodName()
return;
else
{
int y = 3 + 2;
int y = 3 + 2;
}
if (1 == 2)
Expand All @@ -923,7 +923,7 @@ void MethodName()
}
else if (2 == 3)
{
int y = 3 + 2;
int y = 3 + 2;
}
else
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,8 @@ public override void VisitForStatement(ForStatementSyntax node)

public override void VisitIfStatement(IfStatementSyntax node)
{
using (this.AdjustIndentation(1))
int adjustment = node.Parent.IsKind(SyntaxKind.ElseClause) ? 0 : 1;
using (this.AdjustIndentation(adjustment))
{
this.AnalyzeIfStatement(node);
base.VisitIfStatement(node);
Expand Down

0 comments on commit 929a9d1

Please sign in to comment.