Kaydet (Commit) c00de9cd authored tarafından Nick Treleaven's avatar Nick Treleaven

Fix symbol list sort by appearance order for e.g. geany.txt.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1808 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 5402da7a
......@@ -13,6 +13,8 @@
Clear unnecessary default Scintilla Ctrl-D duplicate keybinding.
Add SCI_DELWORDRIGHTEND command (patch sent to Scintilla ML).
Remove previous ScintillaGTK::KeyCommand override.
* src/symbols.c:
Fix symbol list sort by appearance order for e.g. geany.txt.
2007-08-16 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
......
......@@ -304,7 +304,7 @@ typedef struct GeanySymbol
} GeanySymbol;
/* wrapper function to let strcmp work with GeanySymbol struct */
/* sort by name, line */
static gint compare_symbol(const GeanySymbol *a, const GeanySymbol *b)
{
gint ret;
......@@ -320,6 +320,15 @@ static gint compare_symbol(const GeanySymbol *a, const GeanySymbol *b)
}
/* sort by line only */
static gint compare_symbol_lines(const GeanySymbol *a, const GeanySymbol *b)
{
if (a == NULL || b == NULL) return 0;
return a->line - b->line;
}
static const GList *get_tag_list(gint idx, guint tag_types, gboolean sort_by_name)
{
static GList *tag_names = NULL;
......@@ -386,6 +395,8 @@ static const GList *get_tag_list(gint idx, guint tag_types, gboolean sort_by_nam
}
if (sort_by_name)
tag_names = g_list_sort(tag_names, (GCompareFunc) compare_symbol);
else
tag_names = g_list_sort(tag_names, (GCompareFunc) compare_symbol_lines);
return tag_names;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment