[MonoDevelop] Patch for Indent

Todd Berman tberman@sevenl.net
Sun, 11 Apr 2004 20:18:17 -0400


On Mon, 2004-12-04 at 08:25 +0900, Nick D wrote:
> Hi.
> 
> Here's a patch to make code template insertion do some reasonable
> indenting.
> 
> OK to commit this?
> 
> Nick D.

Looks good, except for one thing, when you did this we had a logic bug
in line indentation, so you acquired the same logic bug.

                void IndentLines (int y0, int y1)
                {
-                       string indent = InsertSpacesInsteadOfTabs ? new
string (' ', (int) TabsWidth) : "\t";
-                       
+                       IndentLines (y0, y1, InsertSpacesInsteadOfTabs ?
"\t" : new string (' ', (int) TabsWidth));
+               }

That should be changed to:

                void IndentLines (int y0, int y1)
                {
-                       string indent = InsertSpacesInsteadOfTabs ? new
string (' ', (int) TabsWidth) : "\t";
-                       
+                       IndentLines (y0, y1, InsertSpacesInsteadOfTabs ?
new string (' ', (int) TabsWidth) : "\t");
+               }

its just reversing the spaces vs tabs.

other than that, looks great, go ahead and commit.

--Todd