Author: mkrueger
Date: 2008-02-05 16:25:12 -0500 (Tue, 05 Feb 2008)
New Revision: 94954
Added:
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/FoldingType.cs
Modified:
trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog
trunk/monodevelop/main/src/addins/Mono.Texteditor/Makefile.am
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.mdp
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/Document.cs
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/FoldSegment.cs
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextEditor.cs
Log:
* Mono.TextEditor/Document.cs, Mono.TextEditor/FoldingType.cs,
Mono.TextEditor/TextEditor.cs, Mono.TextEditor/FoldSegment.cs:
Added some folding commands.
Modified: trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog
===================================================================
--- trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog 2008-02-05
21:17:53 UTC (rev 94953)
+++ trunk/monodevelop/main/src/addins/Mono.Texteditor/ChangeLog 2008-02-05
21:25:12 UTC (rev 94954)
@@ -1,5 +1,11 @@
2008-02-05 Mike Krüger <[EMAIL PROTECTED]>
+ * Mono.TextEditor/Document.cs, Mono.TextEditor/FoldingType.cs,
+ Mono.TextEditor/TextEditor.cs, Mono.TextEditor/FoldSegment.cs: Added
+ some folding commands.
+
+2008-02-05 Mike Krüger <[EMAIL PROTECTED]>
+
* Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/Document.cs,
Mono.TextEditor/Caret.cs, Mono.TextEditor/FoldSegment.cs: Improved
folding behavior.
Modified: trunk/monodevelop/main/src/addins/Mono.Texteditor/Makefile.am
===================================================================
--- trunk/monodevelop/main/src/addins/Mono.Texteditor/Makefile.am
2008-02-05 21:17:53 UTC (rev 94953)
+++ trunk/monodevelop/main/src/addins/Mono.Texteditor/Makefile.am
2008-02-05 21:25:12 UTC (rev 94954)
@@ -28,6 +28,7 @@
Mono.TextEditor/DocumentLocation.cs \
Mono.TextEditor/DocumentUpdateRequest.cs \
Mono.TextEditor/EditAction.cs \
+ Mono.TextEditor/FoldingType.cs \
Mono.TextEditor/FoldMarkerMargin.cs \
Mono.TextEditor/FoldSegment.cs \
Mono.TextEditor/GapBuffer.cs \
Modified:
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/Document.cs
===================================================================
---
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/Document.cs
2008-02-05 21:17:53 UTC (rev 94953)
+++
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/Document.cs
2008-02-05 21:25:12 UTC (rev 94954)
@@ -260,6 +260,13 @@
return foldSegments.Count != 0;
}
}
+
+ public ReadOnlyCollection<FoldSegment> FoldSegments {
+ get {
+ return foldSegments.AsReadOnly ();
+ }
+ }
+
public void UpdateFoldSegments (List<FoldSegment> newSegments)
{
if (newSegments == null) {
Modified:
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/FoldSegment.cs
===================================================================
---
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/FoldSegment.cs
2008-02-05 21:17:53 UTC (rev 94953)
+++
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/FoldSegment.cs
2008-02-05 21:25:12 UTC (rev 94954)
@@ -35,6 +35,7 @@
string description;
int column;
int endColumn;
+ FoldingType foldingType;
LineSegment startLine;
LineSegment endLine;
@@ -110,10 +111,20 @@
endColumn = value;
}
}
+
+ public FoldingType FoldingType {
+ get {
+ return foldingType;
+ }
+ set {
+ foldingType = value;
+ }
+ }
- public FoldSegment (string description, int offset, int length)
: base (offset, length)
+ public FoldSegment (string description, int offset, int length,
FoldingType foldingType) : base (offset, length)
{
this.description = description;
+ this.foldingType = foldingType;
}
public override string ToString ()
Added:
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/FoldingType.cs
===================================================================
---
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/FoldingType.cs
2008-02-05 21:17:53 UTC (rev 94953)
+++
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/FoldingType.cs
2008-02-05 21:25:12 UTC (rev 94954)
@@ -0,0 +1,39 @@
+//
+// FoldingType.cs
+//
+// Author:
+// Mike Krüger <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Mono.TextEditor
+{
+ public enum FoldingType {
+ None,
+ Region,
+ TypeDefinition,
+ TypeMember
+ }
+}
Modified:
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextEditor.cs
===================================================================
---
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextEditor.cs
2008-02-05 21:17:53 UTC (rev 94953)
+++
trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor/TextEditor.cs
2008-02-05 21:25:12 UTC (rev 94954)
@@ -1010,6 +1010,7 @@
}
}
}
+
int ScanWord (int offset, bool forwardDirection)
{
LineSegment line = Document.Splitter.GetByOffset
(offset);
@@ -1069,7 +1070,7 @@
void SetAdjustments ()
{
this.textEditorData.VAdjustment.SetBounds (0,
- Splitter.LineCount *
this.LineHeight,
+ (Splitter.LineCount + 10) *
this.LineHeight,
LineHeight,
this.Allocation.Height,
this.Allocation.Height);
Modified: trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.mdp
===================================================================
--- trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.mdp
2008-02-05 21:17:53 UTC (rev 94953)
+++ trunk/monodevelop/main/src/addins/Mono.Texteditor/Mono.TextEditor.mdp
2008-02-05 21:25:12 UTC (rev 94954)
@@ -67,6 +67,7 @@
<File name="gtk-gui/gui.stetic" subtype="Code"
buildaction="EmbedAsResource" />
<File name="gtk-gui/generated.cs" subtype="Code" buildaction="Compile" />
<File name="Mono.TextEditor/TextUtil.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Mono.TextEditor/FoldingType.cs" subtype="Code"
buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches