[anjuta/gnome-2-28] language-support-cpp-java: Align arguments correctly when we have a return type.
- From: Johannes Schmid <jhs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [anjuta/gnome-2-28] language-support-cpp-java: Align arguments correctly when we have a return type.
- Date: Mon, 23 Nov 2009 22:35:04 +0000 (UTC)
commit b6df06cca5be0f1c8c5d130648e657956bb5593f
Author: Johannes Schmid <jhs gnome org>
Date: Mon Nov 23 09:34:30 2009 +0100
language-support-cpp-java: Align arguments correctly when we have a return type.
.../language-support-cpp-java/cpp-java-assist.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/plugins/language-support-cpp-java/cpp-java-assist.c b/plugins/language-support-cpp-java/cpp-java-assist.c
index 84b8ea0..6f8f63d 100644
--- a/plugins/language-support-cpp-java/cpp-java-assist.c
+++ b/plugins/language-support-cpp-java/cpp-java-assist.c
@@ -652,14 +652,22 @@ cpp_java_assist_create_calltips (IAnjutaIterable* iter)
const gchar* name = ianjuta_symbol_get_name(symbol, NULL);
if (name != NULL)
{
- const gchar* args = ianjuta_symbol_get_args(symbol, NULL);
+ const gchar* args = ianjuta_symbol_get_args(symbol, NULL);
const gchar* rettype = ianjuta_symbol_get_returntype (symbol, NULL);
gchar* print_args;
gchar* separator;
- gchar* white_name = g_strnfill (strlen(name) + 1, ' ');
+ gchar* white_name;
+ gint white_count = 0;
+
+ if (!rettype)
+ rettype = "";
+ else
+ white_count += strlen(rettype) + 1;
+
+ white_count += strlen(name) + 1;
+ white_name = g_strnfill (white_count, ' ');
separator = g_strjoin (NULL, ", \n", white_name, NULL);
- //DEBUG_PRINT ("Separator: \n%s", separator);
gchar** argv;
if (!args)
@@ -667,9 +675,6 @@ cpp_java_assist_create_calltips (IAnjutaIterable* iter)
argv = g_strsplit (args, ",", -1);
print_args = g_strjoinv (separator, argv);
-
- if (!rettype)
- rettype = "";
gchar* tip = g_strdup_printf ("%s %s %s", rettype, name, print_args);
@@ -680,6 +685,7 @@ cpp_java_assist_create_calltips (IAnjutaIterable* iter)
g_free (print_args);
g_free (separator);
g_free (white_name);
+
}
else
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]