Add webjumps, history and file completions

When looking for a URL the webjumps, history and file completers are
also used, this should make `clark-find-url' and
`clark-find-url-new-buffer' able to replace `find-url' and
`find-url-new-buffer'.
This commit is contained in:
Tom Willemse 2013-08-26 23:47:29 +02:00
parent f596510d0d
commit 19e80308ef

View file

@ -30,12 +30,29 @@ define_variable("clark_not_bookmarked_string", "-",
"Text to show it the current url has not been"
+ " bookmarked.");
function clark_url_completer () {
keywords(arguments, $sort_order = "visitcount_descending");
var use_webjumps = arguments.$use_webjumps;
var use_history = arguments.$use_history;
var use_bookmarks = arguments.$use_bookmarks;
var sort_order = arguments.$sort_order;
var completers = [];
completers.push(file_path_completer());
if (url_completion_use_webjumps)
completers.push(webjump_completer());
completers.push(clark_complete);
if (url_completion_use_history)
completers.push(history_completer($use_history = true,
$sort_order = sort_order));
return merge_completers(completers);
}
define_browser_object_class(
"clark-bookmark", null,
function (I, prompt) {
check_buffer(I.buffer, content_buffer);
var result = yield I.buffer.window.minibuffer.read(
$prompt = prompt, $completer = clark_complete
$prompt = prompt, $completer = clark_url_completer()
);
yield co_return(result);
}