urlopen: get last URL first

Fix https://github.com/profanity-im/profanity/issues/1348
This commit is contained in:
Michael Vetter
2020-05-29 11:26:18 +02:00
parent e19bf0e303
commit bfaf737efa
3 changed files with 26 additions and 10 deletions

View File

@@ -1163,9 +1163,9 @@ wins_add_urls_ac(const ProfWin *const win, const ProfMessage *const message)
{
gchar *word = g_match_info_fetch (match_info, 0);
autocomplete_add(win->urls_ac, word);
autocomplete_add_reverse(win->urls_ac, word);
// for people who run profanity a long time, we don't want to waste a lot of memory
autocomplete_remove_older_than_max(win->urls_ac, 20);
autocomplete_remove_older_than_max_reverse(win->urls_ac, 20);
g_free (word);
g_match_info_next (match_info, NULL);