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); }