[Monodevelop-patches-list] r801 - trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/FormattingStrategy

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Fri Feb 6 01:58:34 EST 2004


Author: tberman
Date: 2004-02-06 01:58:34 -0500 (Fri, 06 Feb 2004)
New Revision: 801

Modified:
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/FormattingStrategy/CSharpFormattingStrategy.cs
Log:
more junk

i cant handle this fucking code, or this fucking interface, im going to god damned bed


Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/FormattingStrategy/CSharpFormattingStrategy.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/FormattingStrategy/CSharpFormattingStrategy.cs	2004-02-06 06:49:40 UTC (rev 800)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/FormattingStrategy/CSharpFormattingStrategy.cs	2004-02-06 06:58:34 UTC (rev 801)
@@ -32,11 +32,13 @@
 		protected override int SmartIndentLine (IFormattableDocument d, int lineNr)
 		{
 			if (lineNr > 0) {
-				string  lineAboveText = d.GetLineAsString (lineNr - 1).Trim ();
-				string  curLineText = d.GetLineAsString (lineNr).Trim ();
+				string  lineAboveText = d.GetLineAsString (lineNr - 1);
+				string  trimlineAboveText = lineAboveText.Trim ();
+				string  curLineText = d.GetLineAsString (lineNr);
+				string  trimcurLineText = curLineText.Trim ();
 				
-				if ((lineAboveText.EndsWith (")") && curLineText.StartsWith ("{")) ||       // after for, while, etc.
-				    (lineAboveText.EndsWith ("else") && curLineText.StartsWith ("{")))      // after else
+				if ((trimlineAboveText.EndsWith (")") && trimcurLineText.StartsWith ("{")) ||       // after for, while, etc.
+				    (trimlineAboveText.EndsWith ("else") && trimcurLineText.StartsWith ("{")))      // after else
 				{
 					string indentation = GetIndentation (d, lineNr - 1);
 					d.ReplaceLine (lineNr, indentation + curLineText);
@@ -44,7 +46,7 @@
 				}
 				
 				// indent closing bracket.
-				if (curLineText.StartsWith ("}")) {
+				if (trimcurLineText.StartsWith ("}")) {
 					int openLine;
 					int closingBracketOffset = d.GetClosingBraceForLine (lineNr, out openLine);
 					
@@ -73,7 +75,7 @@
 					
 					// special handling for switch statement formatting.
 					if (closingBracketLineText.StartsWith ("switch")) {
-						if (! (lineAboveText.StartsWith ("break;") || lineAboveText.StartsWith ("goto") || lineAboveText.StartsWith ("return")))
+						if (! (trimlineAboveText.StartsWith ("break;") || trimlineAboveText.StartsWith ("goto") || trimlineAboveText.StartsWith ("return")))
 							indentation += d.IndentString;
 					}
 					indentation += d.IndentString;




More information about the Monodevelop-patches-list mailing list