From: Daniel Carl Date: Fri, 26 Jul 2013 18:40:10 +0000 (+0200) Subject: Use titles of url history to filter completion list. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=fc98a6e0e495bedbeef97e141895e8a8744c85d1;p=vimb.git Use titles of url history to filter completion list. --- diff --git a/doc/vimb.1.txt b/doc/vimb.1.txt index e41cd30..f22404e 100644 --- a/doc/vimb.1.txt +++ b/doc/vimb.1.txt @@ -400,8 +400,8 @@ prefix. .TP .B history The history of URLs is shown for the `:open ` and `:tabopen ` commands. This -completion looks up for every given word in the list of the url history. Only -those completion are shown that match every given word. +completion looks up for every given word in the history url and titles. Only +those history items are shown, where the title or url contains all tags. Example: ":open foo bar" will complete only URLs that contain the words foo and diff --git a/src/history.c b/src/history.c index 6c5f7b3..a099381 100644 --- a/src/history.c +++ b/src/history.c @@ -348,7 +348,9 @@ static gboolean history_item_contains_all_tags(History *item, char **query, /* iterate over all query parts */ for (i = 0; i < qlen; i++) { - if (!util_strcasestr(item->first, query[i])) { + if (!(util_strcasestr(item->first, query[i]) + || (item->second && util_strcasestr(item->second, query[i]))) + ) { return false; } }