Author: mkrueger
Date: 2007-09-12 04:33:31 -0400 (Wed, 12 Sep 2007)
New Revision: 85669

Modified:
   trunk/monodevelop/Extras/CSharpBinding/ChangeLog
   trunk/monodevelop/Extras/CSharpBinding/Gui/CSharpTextEditorExtension.cs
Log:
* Gui/CSharpTextEditorExtension.cs: Fixed 82768: Move cursor after new
  summary comment.

Modified: trunk/monodevelop/Extras/CSharpBinding/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/CSharpBinding/ChangeLog    2007-09-12 08:10:44 UTC 
(rev 85668)
+++ trunk/monodevelop/Extras/CSharpBinding/ChangeLog    2007-09-12 08:33:31 UTC 
(rev 85669)
@@ -1,5 +1,10 @@
 2007-09-12  Mike Krüger <[EMAIL PROTECTED]> 
 
+       * Gui/CSharpTextEditorExtension.cs: Fixed 82768: Move cursor after new
+         summary comment.
+
+2007-09-12  Mike Krüger <[EMAIL PROTECTED]> 
+
        * Parser/CodeGenerator.cs: Fixed 82311: Rename fails when we have two
          variables that are called the same.
 

Modified: 
trunk/monodevelop/Extras/CSharpBinding/Gui/CSharpTextEditorExtension.cs
===================================================================
--- trunk/monodevelop/Extras/CSharpBinding/Gui/CSharpTextEditorExtension.cs     
2007-09-12 08:10:44 UTC (rev 85668)
+++ trunk/monodevelop/Extras/CSharpBinding/Gui/CSharpTextEditorExtension.cs     
2007-09-12 08:33:31 UTC (rev 85669)
@@ -57,6 +57,7 @@
                        sb.Append ("/// \n");
                        sb.Append (engine.ThisLineIndent);
                        sb.Append ("/// </summary>");
+                       newCursorOffset = ("/ <summary>\n/// " + 
engine.ThisLineIndent).Length;
                }
                
                string GenerateBody (IClass c, int line)
@@ -95,7 +96,7 @@
                                                builder.Append 
(para.ReturnType.FullyQualifiedName);
                                                builder.Append ("\"/>\n");
                                                builder.Append 
(engine.ThisLineIndent);
-                                               builder.Append ("///</param>");
+                                               builder.Append ("/// </param>");
                                        }
                                }
                                if (method.ReturnType != null && 
method.ReturnType.FullyQualifiedName != "System.Void") {
@@ -107,7 +108,7 @@
                                        builder.Append 
(method.ReturnType.FullyQualifiedName);
                                        builder.Append ("\"/>\n");
                                        builder.Append (engine.ThisLineIndent);
-                                       builder.Append ("///</returns>");
+                                       builder.Append ("/// </returns>");
                                }
 
                        }
@@ -118,6 +119,7 @@
                                builder.Append ("/// \n");
                                builder.Append (engine.ThisLineIndent);
                                builder.Append ("/// </value>");
+                               newCursorOffset = ("/ <value>\n/// " + 
engine.ThisLineIndent).Length;
                        }
                        
                        return builder.ToString ();
@@ -168,9 +170,11 @@
                        return false;
                }
                
+               int newCursorOffset;
                public override bool KeyPress (Gdk.Key key, Gdk.ModifierType 
modifier)
                {
                        bool reindent = false, insert = true;
+                       bool setCursor = true;
                        int nInserted, bufLen, cursor;
                        string newIndent;
                        char ch, c;
@@ -243,6 +247,8 @@
                                        }
                                        
                                        Editor.InsertText (cursor, 
generatedComment.ToString ());
+                                       Editor.CursorPosition = cursor + 
newCursorOffset; 
+                                       setCursor = false;
                                        reindent = true; 
                                        insert = false;
                                }
@@ -403,7 +409,9 @@
                                if (!(reindent || engine.NeedsReindent))
                                        return true;
                        }
-                       
+                       if (!setCursor) {
+                               return true;
+                       }
                        // Get more context but w/o changing our IndentEngine 
state
                        CSharpIndentEngine ctx = (CSharpIndentEngine) 
engine.Clone ();
                        string line = Editor.GetLineText (ctx.LineNumber);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to