Fix quote and url autocompletion for MAM and history
After adding MAM quote and url autocompletion wouldn't pick up messages from MAM or history(from DB) or would have them in the wrong order. This commit fixes that. Fixes https://github.com/profanity-im/profanity/issues/1770
This commit is contained in:
@@ -141,7 +141,7 @@ autocomplete_update(Autocomplete ac, char** items)
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_add_reverse(Autocomplete ac, const char* item)
|
||||
autocomplete_add_unsorted(Autocomplete ac, const char* item, const gboolean is_reversed)
|
||||
{
|
||||
if (ac) {
|
||||
char* item_cpy;
|
||||
@@ -153,7 +153,12 @@ autocomplete_add_reverse(Autocomplete ac, const char* item)
|
||||
}
|
||||
|
||||
item_cpy = strdup(item);
|
||||
ac->items = g_list_prepend(ac->items, item_cpy);
|
||||
|
||||
if (is_reversed) {
|
||||
ac->items = g_list_prepend(ac->items, item_cpy);
|
||||
} else {
|
||||
ac->items = g_list_append(ac->items, item_cpy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ void autocomplete_add_all(Autocomplete ac, char** items);
|
||||
void autocomplete_update(Autocomplete ac, char** items);
|
||||
void autocomplete_remove(Autocomplete ac, const char* const item);
|
||||
void autocomplete_remove_all(Autocomplete ac, char** items);
|
||||
void autocomplete_add_reverse(Autocomplete ac, const char* item);
|
||||
void autocomplete_add_unsorted(Autocomplete ac, const char* item, const gboolean is_reversed);
|
||||
|
||||
// find the next item prefixed with search string
|
||||
gchar* autocomplete_complete(Autocomplete ac, const gchar* search_str, gboolean quote, gboolean previous);
|
||||
|
||||
Reference in New Issue
Block a user