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:
parent
f596510d0d
commit
19e80308ef
1 changed files with 18 additions and 1 deletions
19
clark.js
19
clark.js
|
@ -30,12 +30,29 @@ define_variable("clark_not_bookmarked_string", "-",
|
||||||
"Text to show it the current url has not been"
|
"Text to show it the current url has not been"
|
||||||
+ " bookmarked.");
|
+ " 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(
|
define_browser_object_class(
|
||||||
"clark-bookmark", null,
|
"clark-bookmark", null,
|
||||||
function (I, prompt) {
|
function (I, prompt) {
|
||||||
check_buffer(I.buffer, content_buffer);
|
check_buffer(I.buffer, content_buffer);
|
||||||
var result = yield I.buffer.window.minibuffer.read(
|
var result = yield I.buffer.window.minibuffer.read(
|
||||||
$prompt = prompt, $completer = clark_complete
|
$prompt = prompt, $completer = clark_url_completer()
|
||||||
);
|
);
|
||||||
yield co_return(result);
|
yield co_return(result);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue