[anjuta] language-support-cpp-java: Hide autocompletion if there is nothing more to complete because the full



commit d6760291c9d2346e473231589619320b5b733b3c
Author: Johannes Schmid <jhs gnome org>
Date:   Tue Feb 23 16:57:20 2010 +0100

    language-support-cpp-java: Hide autocompletion if there is nothing more to complete because the full word has been written already.

 .../language-support-cpp-java/cpp-java-assist.c    |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/plugins/language-support-cpp-java/cpp-java-assist.c b/plugins/language-support-cpp-java/cpp-java-assist.c
index 0d4415d..5e238ea 100644
--- a/plugins/language-support-cpp-java/cpp-java-assist.c
+++ b/plugins/language-support-cpp-java/cpp-java-assist.c
@@ -184,7 +184,6 @@ create_completion (CppJavaAssist* assist, IAnjutaIterable* iter,
 			break;
 	}
 	while (ianjuta_iterable_next (iter, NULL));
-	
 	suggestions = g_list_sort (suggestions, completion_compare);
 	g_completion_add_items (completion, suggestions);
 	return completion;
@@ -397,6 +396,17 @@ cpp_java_assist_update_autocomplete (CppJavaAssist *assist)
 	length = g_list_length (completion_list);
 
 	DEBUG_PRINT ("Populating %d proposals", length);
+
+	/* Hide autocompletion if we only have one item */
+	if (length == 1)
+	{
+		CppJavaAssistTag* tag = completion_list->data;
+		if (g_str_equal (tag->name, assist->priv->pre_word))
+		{
+			ianjuta_editor_assist_proposals (assist->priv->iassist, IANJUTA_PROVIDER(assist),
+		                                 NULL, !queries_active, NULL);
+		}
+	}
 	
 	if (length <= max_completions)
 	{



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]