Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/NRefactory.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Grunwald <daniel@danielgrunwald.de>2015-04-22 21:47:07 +0300
committerDaniel Grunwald <daniel@danielgrunwald.de>2015-04-22 21:56:16 +0300
commiteacd465376c0fa7f75c98ee2ab0141aa90ed81c6 (patch)
tree1b4d78febecf820b8dd3cb17f56f8f63670f97fb /ICSharpCode.NRefactory.CSharp
parent2618363a628503ff1edffd26b129eaf65d586c4a (diff)
CSharpOutputVisitor: don't put newline between 'else' and 'if'
Diffstat (limited to 'ICSharpCode.NRefactory.CSharp')
-rw-r--r--ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs b/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs
index d3f8e359..4fc5ed9f 100644
--- a/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs
+++ b/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs
@@ -1509,7 +1509,12 @@ namespace ICSharpCode.NRefactory.CSharp
WriteEmbeddedStatement(ifElseStatement.TrueStatement);
if (!ifElseStatement.FalseStatement.IsNull) {
WriteKeyword(IfElseStatement.ElseKeywordRole);
- WriteEmbeddedStatement(ifElseStatement.FalseStatement);
+ if (ifElseStatement.FalseStatement is IfElseStatement) {
+ // don't put newline between 'else' and 'if'
+ ifElseStatement.FalseStatement.AcceptVisitor(this);
+ } else {
+ WriteEmbeddedStatement(ifElseStatement.FalseStatement);
+ }
}
EndNode(ifElseStatement);
}