Author: mkrueger
Date: 2008-02-19 08:26:16 -0500 (Tue, 19 Feb 2008)
New Revision: 96137

Modified:
   trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog
   
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb
   
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs
   
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs
Log:
* Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextEditorData.cs,
  Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb: Fixed Bug 362887
  - Paste command pastes text to the wrong location.

Modified: trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog
===================================================================
--- trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog 2008-02-19 
13:17:24 UTC (rev 96136)
+++ trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog 2008-02-19 
13:26:16 UTC (rev 96137)
@@ -1,5 +1,11 @@
 2008-02-19  Mike Krüger <[EMAIL PROTECTED]> 
 
+       * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextEditorData.cs,
+         Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb: Fixed Bug 362887 -
+         Paste command pastes text to the wrong location.
+
+2008-02-19  Mike Krüger <[EMAIL PROTECTED]> 
+
        * Mono.TextEditor.Tests/Mono.TextEditor.Tests.mdp,
          
Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs:
          Added some tests for the insert tab behavior.

Modified: 
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs
===================================================================
--- 
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs
 2008-02-19 13:17:24 UTC (rev 96136)
+++ 
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs
 2008-02-19 13:26:16 UTC (rev 96137)
@@ -258,10 +258,10 @@
                                return;
                        document.BeginAtomicUndo ();
                        ISegment selection = SelectionRange;
+                       
                        bool needUpdate = Document.OffsetToLineNumber 
(selection.Offset) != Document.OffsetToLineNumber (selection.EndOffset);
                        if (Caret.Offset > selection.Offset)
-                               Caret.Offset -= selection.Length;
-                       
+                               Caret.Offset -= System.Math.Min 
(selection.Length, Caret.Offset - selection.Offset);
                        Document.Remove (selection.Offset, selection.Length);
                        if (needUpdate)
                                Document.RequestUpdate (new LineToEndUpdate 
(Document.OffsetToLineNumber (selection.Offset)));

Modified: 
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs
===================================================================
--- 
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs
 2008-02-19 13:17:24 UTC (rev 96136)
+++ 
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs
 2008-02-19 13:26:16 UTC (rev 96137)
@@ -496,6 +496,8 @@
                                if (type == EventType.TwoButtonPress) {
                                        int start = ScanWord (offset, false);
                                        int end   = ScanWord (offset, true);
+                                       Caret.Offset = end;
+                                       textEditor.SelectionAnchor = start;
                                        textEditor.SelectionRange = new Segment 
(start, end - start);
                                        inSelectionDrag = true;
                                        mouseSelectionMode = 
MouseSelectionMode.Word;
@@ -514,6 +516,8 @@
                                        inSelectionDrag = true;
                                        if ((modifierState & 
Gdk.ModifierType.ShiftMask) == ModifierType.ShiftMask) {
                                                Caret.PreserveSelection = true;
+                                               if 
(!textEditor.IsSomethingSelected)
+                                                       
textEditor.SelectionAnchor = Caret.Offset;
                                                Caret.Location = clickLocation;
                                                Caret.PreserveSelection = false;
                                                textEditor.ExtendSelectionTo 
(clickLocation);

Modified: 
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb
===================================================================
(Binary files differ)

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

Reply via email to