[anjuta] Adapt the sourceview plugin to the new IAnjutaEditorAssist API



commit ae35d343389c248d2d8d26384cd6e071d8174637
Author: Moritz LÃdecke <ritze skweez net>
Date:   Mon Jul 23 17:44:52 2012 +0200

    Adapt the sourceview plugin to the new IAnjutaEditorAssist API

 plugins/sourceview/sourceview.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/plugins/sourceview/sourceview.c b/plugins/sourceview/sourceview.c
index ab9b33c..5fb346a 100644
--- a/plugins/sourceview/sourceview.c
+++ b/plugins/sourceview/sourceview.c
@@ -43,6 +43,7 @@
 #include <libanjuta/interfaces/ianjuta-editor-search.h>
 #include <libanjuta/interfaces/ianjuta-editor-hover.h>
 #include <libanjuta/interfaces/ianjuta-editor-glade-signal.h>
+#include <libanjuta/interfaces/ianjuta-language-provider.h>
 #include <libanjuta/interfaces/ianjuta-provider.h>
 
 #include <gtksourceview/gtksourceview.h>
@@ -2315,9 +2316,19 @@ static void
 iassist_proposals(IAnjutaEditorAssist* iassist,
                   IAnjutaProvider* provider,
                   GList* proposals,
+                  const gchar* pre_word,
                   gboolean finished,
                   GError** e)
 {
+	/* Hide if the only suggetions is exactly the typed word */
+	if (pre_word && proposals && g_list_length (proposals) == 1)
+	{
+		IAnjutaEditorAssistProposal* proposal = proposals->data;
+		IAnjutaLanguageProviderProposalData* data = proposal->data;
+		if (g_str_equal (pre_word, data->name))
+			proposals = NULL;
+	}
+	
 	Sourceview* sv = ANJUTA_SOURCEVIEW(iassist);
 	GtkSourceCompletion* completion = gtk_source_view_get_completion(GTK_SOURCE_VIEW(sv->priv->view));
 	GList* node;



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