Browse Source

* Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs: If statements

without block are now correctly indented.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4323 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mike Krüger 16 years ago
parent
commit
52cefeecb0
  1. 7
      src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs

7
src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs

@ -1290,10 +1290,17 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -1290,10 +1290,17 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
}
if (statements.Count != 1) {
outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
} else {
outputFormatter.NewLine ();
outputFormatter.IndentationLevel++;
outputFormatter.Indent ();
}
foreach (Statement stmt in statements) {
TrackVisit(stmt, prettyPrintOptions.StatementBraceStyle);
}
if (statements.Count == 1) {
outputFormatter.IndentationLevel--;
}
if (statements.Count != 1) {
outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
}

Loading…
Cancel
Save