Revision: 5731
http://geany.svn.sourceforge.net/geany/?rev=5731&view=rev
Author: ntrel
Date: 2011-04-19 16:43:23 +0000 (Tue, 19 Apr 2011)
Log Message:
-----------
Remove snippets_global_pattern global and use user_data instead.
Modified Paths:
--------------
trunk/src/editor.c
Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c 2011-04-19 16:36:29 UTC (rev 5730)
+++ trunk/src/editor.c 2011-04-19 16:43:23 UTC (rev 5731)
@@ -2289,22 +2289,17 @@
}
-/* This is very ugly but passing the pattern to ac_replace_specials() doesn't work because it is
- * modified when replacing a completion but the foreach function still passes the old pointer
- * to ac_replace_specials, so we use a global pointer outside of ac_replace_specials and
- * ac_complete_constructs. Any hints to improve this are welcome. */
-static GString *snippets_global_pattern = NULL;
-
static void snippets_replace_specials(gpointer key, gpointer value, gpointer user_data)
{
gchar *needle;
+ GString *pattern = user_data;
g_return_if_fail(key != NULL);
g_return_if_fail(value != NULL);
needle = g_strconcat("%", (gchar*) key, "%", NULL);
- utils_string_replace_all(snippets_global_pattern, needle, (gchar*) value);
+ utils_string_replace_all(pattern, needle, (gchar*) value);
g_free(needle);
}
@@ -2502,9 +2497,7 @@
specials = g_hash_table_lookup(snippet_hash, "Special");
if (G_LIKELY(specials != NULL))
{
- /* ugly hack using global_pattern */
- snippets_global_pattern = pattern;
- g_hash_table_foreach(specials, snippets_replace_specials, NULL);
+ g_hash_table_foreach(specials, snippets_replace_specials, pattern);
}
/* now transform other wildcards */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5728
http://geany.svn.sourceforge.net/geany/?rev=5728&view=rev
Author: eht16
Date: 2011-04-17 13:41:54 +0000 (Sun, 17 Apr 2011)
Log Message:
-----------
Use document_compare_by_tab_order() as default compare function to sort the document list in the document notebook tab menu, this fixes the currently broken default ordering.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/ui_utils.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2011-04-17 13:40:04 UTC (rev 5727)
+++ trunk/ChangeLog 2011-04-17 13:41:54 UTC (rev 5728)
@@ -4,6 +4,10 @@
plugins/geanyfunctions.h:
Add document_compare_by_tab_order() and
document_compare_by_tab_order_reverse() to the plugin API.
+ * src/ui_uitls.c:
+ Use document_compare_by_tab_order() as default compare function
+ to sort the document list in the document notebook tab menu, this
+ fixes the currently broken default ordering.
2011-04-15 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c 2011-04-17 13:40:04 UTC (rev 5727)
+++ trunk/src/ui_utils.c 2011-04-17 13:41:54 UTC (rev 5728)
@@ -2430,9 +2430,11 @@
{
g_ptr_array_add(sorted_documents, documents[i]);
}
+ if (compare_func == NULL)
+ compare_func = document_compare_by_tab_order;
+
/* and now sort it */
- if (compare_func != NULL)
- g_ptr_array_sort(sorted_documents, compare_func);
+ g_ptr_array_sort(sorted_documents, compare_func);
for (i = 0; i < sorted_documents->len; i++)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.