summaryrefslogtreecommitdiff
path: root/ide-definitions.c
diff options
context:
space:
mode:
Diffstat (limited to 'ide-definitions.c')
-rw-r--r--ide-definitions.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ide-definitions.c b/ide-definitions.c
index 7175e08..185a270 100644
--- a/ide-definitions.c
+++ b/ide-definitions.c
@@ -113,7 +113,13 @@ static int definition_entry_qsort_cmp(const void *av, const void *bv) {
if (a_len < b_len) return -1;
if (a_len > b_len) return 1;
// then sort alphabetically
- return strcmp(a->name, b->name);
+ int cmp = strcmp(a->name, b->name);
+ if (cmp) return cmp;
+ // then sort by detail
+ if (!a->detail && b->detail) return -1;
+ if (a->detail && !b->detail) return 1;
+ if (!a->detail && !b->detail) return 0;
+ return strcmp(a->detail, b->detail);
}
// put the entries matching the search term into the selector.