Author: mkrueger
Date: 2008-02-19 14:43:08 -0500 (Tue, 19 Feb 2008)
New Revision: 96176
Modified:
trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/DefaultEditActions.cs
Log:
* Mono.TextEditor/DefaultEditActions.cs,
Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb,
Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs:
Found insert tab case that failed.
Modified: trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog
===================================================================
--- trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog 2008-02-19
19:35:42 UTC (rev 96175)
+++ trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog 2008-02-19
19:43:08 UTC (rev 96176)
@@ -1,5 +1,12 @@
2008-02-19 Mike Krüger <[EMAIL PROTECTED]>
+ * Mono.TextEditor/DefaultEditActions.cs,
+ Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb,
+
Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs:
+ Found insert tab case that failed.
+
+2008-02-19 Mike Krüger <[EMAIL PROTECTED]>
+
* Mono.TextEditor/DefaultEditActions.cs,
Mono.TextEditor/TextEditorData.cs,
Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/SelectionSelectAllTests.cs:
Fixed "Bug 362983 - Text selected with Select All can't be unselected"
Modified:
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/DefaultEditActions.cs
===================================================================
---
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/DefaultEditActions.cs
2008-02-19 19:35:42 UTC (rev 96175)
+++
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/DefaultEditActions.cs
2008-02-19 19:43:08 UTC (rev 96176)
@@ -630,7 +630,8 @@
}
if (data.IsSomethingSelected) {
if (data.SelectionAnchor < data.Caret.Offset) {
- data.SelectionAnchor = System.Math.Min
(anchorLine.Offset + anchorLine.EditableLength, System.Math.Max
(anchorLine.Offset, data.SelectionAnchor +
TextEditorOptions.Options.IndentationString.Length));
+ if (anchorColumn != 0)
+ data.SelectionAnchor =
System.Math.Min (anchorLine.Offset + anchorLine.EditableLength, System.Math.Max
(anchorLine.Offset, data.SelectionAnchor +
TextEditorOptions.Options.IndentationString.Length));
} else {
if (anchorColumn != 0) {
data.SelectionAnchor =
System.Math.Min (anchorLine.Offset + anchorLine.EditableLength, System.Math.Max
(anchorLine.Offset, anchorLine.Offset + anchorColumn +
TextEditorOptions.Options.IndentationString.Length));
Modified:
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs
===================================================================
---
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs
2008-02-19 19:35:42 UTC (rev 96175)
+++
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs
2008-02-19 19:43:08 UTC (rev 96176)
@@ -193,6 +193,34 @@
Assert.AreEqual (data.Document.GetLine(1).Length,
data.Document.GetLine(2).Length);
}
+ [Test()]
+ public void TestInsertTabLineCase4 ()
+ {
+ TextEditorData data = new
Mono.TextEditor.TextEditorData ();
+ data.Document.Text =
+@"123d456789
+[123456789
+123d456789
+123]456789
+123456789
+123456789";
+ SetSelection (data, false);
+
+ new InsertTab ().Run (data);
+ ISegment currentSelection = GetSelection (data, false);
+
+ Assert.AreEqual (currentSelection.EndOffset,
data.SelectionRange.EndOffset);
+ Assert.AreEqual (currentSelection.EndOffset,
data.Caret.Offset);
+
+ Assert.AreEqual (data.Document.GetLine(1).Offset,
data.SelectionRange.Offset);
+
+ Assert.Greater (data.Document.GetLine(1).Length,
data.Document.GetLine(0).Length);
+ Assert.Greater (data.Document.GetLine(2).Length,
data.Document.GetLine(0).Length);
+ Assert.Greater (data.Document.GetLine(3).Length,
data.Document.GetLine(0).Length);
+
+ Assert.AreEqual (data.Document.GetLine(1).Length,
data.Document.GetLine(2).Length);
+ }
+
[TestFixtureSetUp]
public void SetUp()
{
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