[gnome-builder/gnome-builder-3-18] completion: use fuzzy highlight helper



commit e30445a9667a0cd856ae56b38ebef3a6affbb039
Author: Christian Hergert <christian hergert me>
Date:   Thu Oct 1 22:54:01 2015 -0700

    completion: use fuzzy highlight helper

 plugins/ctags/ide-ctags-completion-item.c       |    2 +-
 plugins/vala-pack/ide-vala-completion-item.vala |    7 ++-----
 2 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/plugins/ctags/ide-ctags-completion-item.c b/plugins/ctags/ide-ctags-completion-item.c
index 6a226ab..b6e618e 100644
--- a/plugins/ctags/ide-ctags-completion-item.c
+++ b/plugins/ctags/ide-ctags-completion-item.c
@@ -114,7 +114,7 @@ get_markup (GtkSourceCompletionProposal *proposal)
   IdeCtagsCompletionItem *self = (IdeCtagsCompletionItem *)proposal;
 
   if (self->provider->current_word != NULL)
-    return gb_str_highlight (self->entry->name, self->provider->current_word);
+    return ide_completion_item_fuzzy_highlight (self->entry->name, self->provider->current_word);
 
   return g_strdup (self->entry->name);
 }
diff --git a/plugins/vala-pack/ide-vala-completion-item.vala b/plugins/vala-pack/ide-vala-completion-item.vala
index c5339d9..c48e556 100644
--- a/plugins/vala-pack/ide-vala-completion-item.vala
+++ b/plugins/vala-pack/ide-vala-completion-item.vala
@@ -129,8 +129,8 @@ namespace Ide
 
                public string get_markup () {
                        if (this.provider.query != null)
-                               return highlight_full (this.label, this.provider.query, true, 1 /* 
GB_HIGHLIGHT_BOLD */);
-                       return "";
+                               return Ide.CompletionItem.fuzzy_highlight (this.label, this.provider.query);
+                       return this.label;
                }
 
                public string get_label () {
@@ -155,7 +155,4 @@ namespace Ide
                        return this.symbol.name.hash () ^ hash_seed;
                }
        }
-
-       [CCode (cheader_filename = "gb-string.h", cname = "gb_str_highlight_full")]
-       extern unowned string? highlight_full (string haystack, string needle, bool insensitive, int type);
 }


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