diff options
author | Mike Krüger <mkrueger@novell.com> | 2009-06-18 09:21:31 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@novell.com> | 2009-06-18 09:21:31 +0400 |
commit | aa87faa703d6dc32b3919a16a32a54d5ea9c4c81 (patch) | |
tree | 44879489e1e855abf718df5877a7819114a45fd3 /main/contrib | |
parent | e51c0ee627cbbb421330a02cdf54c6b7cd874703 (diff) |
* Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs: Single line if
statements are now correcty indented.
svn path=/trunk/monodevelop/; revision=136377
Diffstat (limited to 'main/contrib')
-rw-r--r-- | main/contrib/NRefactory/Project/ChangeLog | 5 | ||||
-rw-r--r-- | main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/main/contrib/NRefactory/Project/ChangeLog b/main/contrib/NRefactory/Project/ChangeLog index 6dfa5bad2d..0d0a28bcce 100644 --- a/main/contrib/NRefactory/Project/ChangeLog +++ b/main/contrib/NRefactory/Project/ChangeLog @@ -1,3 +1,8 @@ +2009-06-18 Mike Krüger <mkrueger@novell.com> + + * Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs: Single line + if statements are now correcty indented. + 2009-06-17 Mike Krüger <mkrueger@novell.com> * Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs: Corrected diff --git a/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs b/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs index ee98e2a6a9..79a4d45341 100644 --- a/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs +++ b/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs @@ -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); } |