[gnome-builder] ctags: remove dups
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] ctags: remove dups
- Date: Mon, 28 Sep 2015 13:37:48 +0000 (UTC)
commit c7aface96781e67480ad68eab519069d40fea45c
Author: Christian Hergert <christian hergert me>
Date: Mon Sep 28 06:37:34 2015 -0700
ctags: remove dups
We generate our lists sorted, so these will often show up right next
to one another. Just do the simple thing rather than mucking around with
the IdeCompletionResults.
plugins/ctags/ide-ctags-completion-provider.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/plugins/ctags/ide-ctags-completion-provider.c b/plugins/ctags/ide-ctags-completion-provider.c
index 94ddf96..315c55c 100644
--- a/plugins/ctags/ide-ctags-completion-provider.c
+++ b/plugins/ctags/ide-ctags-completion-provider.c
@@ -19,6 +19,7 @@
#define G_LOG_DOMAIN "ide-ctags-completion-provider"
#include <glib/gi18n.h>
+#include <ide.h>
#include "ide-completion-provider.h"
#include "ide-completion-item.h"
@@ -207,6 +208,7 @@ ide_ctags_completion_provider_populate (GtkSourceCompletionProvider *provider,
g_autofree gchar *copy = g_strdup (self->current_word);
IdeCtagsIndex *index = g_ptr_array_index (self->indexes, i);
const IdeCtagsIndexEntry *entries = NULL;
+ const gchar *last_name = NULL;
guint tmp_len = word_len;
gsize n_entries = 0;
@@ -224,6 +226,11 @@ ide_ctags_completion_provider_populate (GtkSourceCompletionProvider *provider,
const IdeCtagsIndexEntry *entry = &entries [j];
IdeCtagsCompletionItem *item;
+ if (ide_str_equal0 (entry->name, last_name))
+ continue;
+
+ last_name = entry->name;
+
if (!ide_ctags_is_allowed (entry, allowed))
continue;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]