[Monodevelop-patches-list] r1529 - in trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor: . Gui

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Tue Apr 27 19:59:21 EDT 2004


Author: tberman
Date: 2004-04-27 19:59:21 -0400 (Tue, 27 Apr 2004)
New Revision: 1529

Modified:
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
Log:
reuse the delegate, and try to update a bit smarter.


Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-04-27 23:58:51 UTC (rev 1528)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-04-27 23:59:21 UTC (rev 1529)
@@ -1,5 +1,10 @@
 2004-04-27  Todd Berman  <tberman at sevenl.net>
 
+	* Gui/SourceEditorDisplayBinding.cs: workaround some to reduce the
+	amount of times the idle handler is called, and to reuse the delegate.
+
+2004-04-27  Todd Berman  <tberman at sevenl.net>
+
 	* Gui/SourceEditorBuffer.cs:
 	* Gui/SourceEditorView.cs:
 	* Gui/SourceEditorDisplayBinding.cs: update to match gsv-sharp from

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-04-27 23:58:51 UTC (rev 1528)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-04-27 23:59:21 UTC (rev 1529)
@@ -226,9 +226,15 @@
 		}
 		
 		string cachedText;
+		GLib.IdleHandler bouncingDelegate;
+		
 		public string Text {
 			get {
-				GLib.Idle.Add (new GLib.IdleHandler (BounceAndGrab));
+				if (bouncingDelegate == null)
+					bouncingDelegate = new GLib.IdleHandler (BounceAndGrab);
+				if (needsUpdate) {
+					GLib.Idle.Add (bouncingDelegate);
+				}
 				return cachedText;
 			}
 			set { se.Buffer.Text = value; }
@@ -239,6 +245,7 @@
 		{
 			if (needsUpdate) {
 				cachedText = se.Buffer.Text;
+				needsUpdate = false;
 			}
 			return false;
 		}
@@ -261,7 +268,6 @@
 		{
 			// 99% of the time, this is the insertion point
 			UpdateLineCol ();
-			needsUpdate = true;
 		}
 		
 		void OnChanged (object o, EventArgs e)




More information about the Monodevelop-patches-list mailing list