Author: jackson
Date: 2007-04-04 13:03:04 -0400 (Wed, 04 Apr 2007)
New Revision: 75398

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
Log:

        * TextBoxBase.cs: When the user presses enter, insert a line
        ending into the text. (Maybe this would be a good spot for
        Environment.NewLine).
        * TextControl.cs: Remove undo manager hack, line endings get
        inserted properly now.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-04 16:10:19 UTC (rev 75397)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-04 17:03:04 UTC (rev 75398)
@@ -1,3 +1,11 @@
+2007-04-04  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * TextBoxBase.cs: When the user presses enter, insert a line
+       ending into the text. (Maybe this would be a good spot for
+       Environment.NewLine).
+       * TextControl.cs: Remove undo manager hack, line endings get
+       inserted properly now.
+       
 2007-04-04  Everaldo Canuto  <[EMAIL PROTECTED]>
 
        * MenuAPI.cs: 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2007-04-04 16:10:19 UTC (rev 75397)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2007-04-04 17:03:04 UTC (rev 75398)
@@ -1100,13 +1100,15 @@
                                                Line    line;
 
                                                if (document.selection_visible) 
{
-                                                       
document.ReplaceSelection("", false);
+                                                       
document.ReplaceSelection("\n", false);
                                                }
 
                                                line = document.CaretLine;
 
                                                document.Split 
(document.CaretLine, document.CaretTag, document.CaretPosition);
                                                line.ending = LineEnding.Rich;
+                                               document.InsertString (line, 
line.text.Length,
+                                                               
document.LineEndingToString (line.ending));
                                                OnTextChanged(EventArgs.Empty);
                                                document.UpdateView(line, 2, 0);
 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs   
2007-04-04 16:10:19 UTC (rev 75397)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs   
2007-04-04 17:03:04 UTC (rev 75398)
@@ -2215,7 +2215,7 @@
                        }
 
                        InsertString (line, pos, s.Substring (0, break_index + 
LineEndingLength (ending)));
-
+                       
                        break_index += LineEndingLength (ending);
                        while (break_index < s.Length) {
                                int next_break = GetLineEnding (s, break_index, 
out ending);
@@ -5248,10 +5248,7 @@
                                        continue;
 
                                // Text for the tag
-                               if (current.text.Length > start)
-                                       line.text = new StringBuilder 
(current.text.ToString (start, end - start));
-                               else
-                                       line.text = new StringBuilder ();
+                               line.text = new StringBuilder 
(current.text.ToString (start, end - start));
                                
                                // Copy tags from start to start+length onto 
new line
                                current_tag = current.FindTag (start);

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

Reply via email to