[gnome-builder] clang: fix escaping of parameters from clang
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] clang: fix escaping of parameters from clang
- Date: Wed, 13 Jun 2018 00:38:03 +0000 (UTC)
commit c375898b4a7e733307d43c19650bd6ee9f250f7e
Author: Christian Hergert <chergert redhat com>
Date: Tue Jun 12 17:36:31 2018 -0700
clang: fix escaping of parameters from clang
Clang can include <> in parameters, so we need to escape that for GMarkup.
src/plugins/clang/ide-clang-completion-provider.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/clang/ide-clang-completion-provider.c
b/src/plugins/clang/ide-clang-completion-provider.c
index 66b5ffe3b..45fd0095d 100644
--- a/src/plugins/clang/ide-clang-completion-provider.c
+++ b/src/plugins/clang/ide-clang-completion-provider.c
@@ -278,6 +278,7 @@ ide_clang_completion_provider_display_proposal (IdeCompletionProvider *provide
g_autofree gchar *escaped = NULL;
g_autofree gchar *markup = NULL;
g_autofree gchar *highlight = NULL;
+ g_autofree gchar *params_escaped = NULL;
g_assert (IDE_IS_CLANG_COMPLETION_PROVIDER (provider));
g_assert (IDE_IS_COMPLETION_LIST_BOX_ROW (row));
@@ -285,13 +286,15 @@ ide_clang_completion_provider_display_proposal (IdeCompletionProvider *provide
g_assert (IDE_IS_CLANG_COMPLETION_ITEM (item));
escaped = g_markup_escape_text (item->typed_text, -1);
+ if (item->params != NULL)
+ params_escaped = g_markup_escape_text (item->params, -1);
highlight = ide_completion_fuzzy_highlight (escaped, typed_text);
ide_completion_list_box_row_set_icon_name (row, item->icon_name);
ide_completion_list_box_row_set_left (row, item->return_type);
markup = g_strdup_printf ("%s%s<span fgalpha='32767'>%s</span>",
highlight,
item->params ? " " : "",
- item->params ?: "");
+ params_escaped ?: "");
ide_completion_list_box_row_set_center_markup (row, markup);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]