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

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sat Apr 24 23:10:49 EDT 2004


Author: tberman
Date: 2004-04-24 23:10:49 -0400 (Sat, 24 Apr 2004)
New Revision: 1497

Modified:
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs
Log:
fix random code completion unusability issue


Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-04-24 21:26:48 UTC (rev 1496)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-04-25 03:10:49 UTC (rev 1497)
@@ -1,5 +1,11 @@
 2004-04-24  Todd Berman  <tberman at sevenl.net>
 
+	* CodeCompletion/CompletionWindow.cs: make sure to properly handle
+	people typing things other than whats in our window (that is legal
+	too... (for now ;) )).
+
+2004-04-24  Todd Berman  <tberman at sevenl.net>
+
 	* CodeCompletion/CodeCompletionDataProvider.cs: hook into is/as resolve
 	method.
 

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs	2004-04-24 21:26:48 UTC (rev 1496)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs	2004-04-25 03:10:49 UTC (rev 1497)
@@ -23,7 +23,7 @@
 		ICompletionDataProvider completionDataProvider;
 		SourceEditorView control;
 		TreeView listView;
-		TreeStore store;
+		ListStore store;
 		TextMark triggeringMark;
 		int origOffset;
 		int num_in = 0;
@@ -67,6 +67,10 @@
 				case ';':
 				case '(':
 				case '[':
+				case (char) Gdk.Key.Return:
+				case (char) Gdk.Key.ISO_Enter:
+				case (char) Gdk.Key.Key_3270_Enter:
+				case (char) Gdk.Key.KP_Enter:
 					control.SimulateKeyPress (ref e);
 					LostFocusListView (null, null);
 					return true;
@@ -114,7 +118,9 @@
 
 				default:
 					if (val != '_' && !Char.IsLetterOrDigit (val)) {
-						if (listView.Selection.CountSelectedRows () > 0) {
+						TreeModel mdl;
+						TreeIter itr;
+						if (listView.Selection.GetSelected (out mdl, out itr)) {
 							ActivateItem (null, null);
 						} else {
 							LostFocusListView (null, null);
@@ -181,6 +187,10 @@
 					return true;
 				}
 			}
+			if (numOfHits == 0) {
+				control.buf.DropCompleteAhead ();
+				listView.Selection.UnselectAll ();
+			}
 			return false;
 		}
 		
@@ -191,7 +201,7 @@
 			SkipTaskbarHint = true;
 			TypeHint = Gdk.WindowTypeHint.Dialog;
 			
-			store = new Gtk.TreeStore (typeof (string), typeof (Gdk.Pixbuf), typeof(ICompletionData));
+			store = new Gtk.ListStore (typeof (string), typeof (Gdk.Pixbuf), typeof(ICompletionData));
 			listView = new Gtk.TreeView (store);
 			listView.HeadersVisible = false;
 
@@ -298,10 +308,9 @@
 		
 		void ActivateItem (object sender, RowActivatedArgs e)
 		{
-			if (listView.Selection.CountSelectedRows () > 0) {
-				TreeModel foo;
-				TreeIter iter;
-				listView.Selection.GetSelected (out foo, out iter);
+			TreeModel foo;
+			TreeIter iter;
+			if (listView.Selection.GetSelected (out foo, out iter)) {
 				ICompletionData data = (ICompletionData) store.GetValue (iter, 2);
 				control.buf.DropCompleteAhead ();
 				DeleteInsertion ();




More information about the Monodevelop-patches-list mailing list