mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-28 03:35:45 +01:00
Add "t" option to 'complete'. Visually it looks odd, that the icons are
more indented than others, we might want to remove or at least move the % and # indicators
This commit is contained in:
@@ -1491,7 +1491,20 @@ const liberator = (function () //{{{
|
||||
// convert the string to an array of converted URLs
|
||||
// -> see util.stringToURLArray for more details
|
||||
if (typeof urls == "string")
|
||||
{
|
||||
// rather switch to the tab instead of opening a new url in case of "12: Tab Title" like "urls"
|
||||
if (liberator.has("tabs"))
|
||||
{
|
||||
let matches = urls.match(/^(\d+):/);
|
||||
if (matches)
|
||||
{
|
||||
tabs.select(parseInt(matches[1], 10) - 1, false); // make it zero-based
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
urls = util.stringToURLArray(urls);
|
||||
}
|
||||
|
||||
if (urls.length > 20 && !force)
|
||||
{
|
||||
|
||||
@@ -645,6 +645,10 @@ function Tabs() //{{{
|
||||
{ argCount: "0" });
|
||||
}
|
||||
|
||||
completion.addUrlCompleter("t",
|
||||
"Open tabs",
|
||||
completion.buffer);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////}}}
|
||||
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
@@ -770,7 +770,7 @@ function CommandLine() //{{{
|
||||
|
||||
options.add(["complete", "cpt"],
|
||||
"Items which are completed at the :open prompts",
|
||||
"charlist", "slf",
|
||||
"charlist", typeof(config.defaults["complete"]) == "string" ? config.defaults["complete"] : "slf",
|
||||
{
|
||||
completer: function (context) [k for each (k in completion.urlCompleters)],
|
||||
validator: Option.validateCompleter
|
||||
|
||||
Reference in New Issue
Block a user