[Monodevelop-patches-list] r951 - trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Thu Feb 19 16:17:47 EST 2004


Author: tberman
Date: 2004-02-19 16:17:47 -0500 (Thu, 19 Feb 2004)
New Revision: 951

Modified:
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs
Log:
much faster now


Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs	2004-02-19 21:06:34 UTC (rev 950)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs	2004-02-19 21:17:47 UTC (rev 951)
@@ -411,21 +411,27 @@
 
 		public int Length
 		{
-			get { return Text.Length; }
+			get { return EndIter.Offset + 1; }
 		}
 
 		public char GetCharAt (int offset)
 		{
 			if (offset < 0)
 				offset = 0;
-			Console.WriteLine ("[GetCharAt] ({0})", offset);
-			return Text[offset];
+			TextIter begin_iter = GetIterAtOffset (offset);
+			TextIter next_iter = begin_iter;
+			next_iter.ForwardChar ();
+			string text = GetText (begin_iter, next_iter, true);
+			if (text != null && text.Length >= 1)
+				return text[0];
+			return ' ';
 		}
 
 		public string GetText (int start, int length)
 		{
-			Console.WriteLine ("[GetText] ({0}) -- ({1})", start, length);
-			return Text.Substring (start, length);
+			TextIter begin_iter = GetIterAtOffset (start);
+			TextIter end_iter = GetIterAtOffset (start + length);
+			return GetText (begin_iter, end_iter, true);
 		}
 
 		public void Insert (int offset, string text)




More information about the Monodevelop-patches-list mailing list