From 19e80308ef679014749d19595e3ca7ae7a10ffa0 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 26 Aug 2013 23:47:29 +0200 Subject: [PATCH] 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'. --- clark.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/clark.js b/clark.js index 31dbc26..860537f 100644 --- a/clark.js +++ b/clark.js @@ -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); }