[gnome-builder/wip/gtk4-port] clang: include params with typed text column



commit 00cb6cba5610e73e1ec75a3600d3a1704186962b
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jun 5 20:11:19 2022 -0700

    clang: include params with typed text column
    
    It just looks better to have them juxtapose.

 src/plugins/clang/ide-clang-completion-item.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/clang/ide-clang-completion-item.c b/src/plugins/clang/ide-clang-completion-item.c
index 0be60b8e2..31aaed836 100644
--- a/src/plugins/clang/ide-clang-completion-item.c
+++ b/src/plugins/clang/ide-clang-completion-item.c
@@ -499,10 +499,15 @@ ide_clang_completion_item_display (IdeClangCompletionItem  *self,
 
     case GTK_SOURCE_COMPLETION_COLUMN_TYPED_TEXT:
       {
+        g_autofree char *with_params = NULL;
+        const char *text = self->typed_text;
         PangoAttrList *attrs;
 
+        if (text != NULL && self->params != NULL)
+          text = with_params = g_strdup_printf ("%s %s", text, self->params);
+
         attrs = gtk_source_completion_fuzzy_highlight (self->typed_text, typed_text);
-        gtk_source_completion_cell_set_text_with_attributes (cell, self->typed_text, attrs);
+        gtk_source_completion_cell_set_text_with_attributes (cell, text, attrs);
         pango_attr_list_unref (attrs);
 
         break;
@@ -528,7 +533,7 @@ ide_clang_completion_item_display (IdeClangCompletionItem  *self,
       break;
 
     case GTK_SOURCE_COMPLETION_COLUMN_AFTER:
-      gtk_source_completion_cell_set_text (cell, self->params);
+      gtk_source_completion_cell_set_text (cell, NULL);
       break;
 
     default:


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