1
0
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:
Martin Stubenschrott
2009-07-31 18:21:32 +02:00
parent 98abc30ea3
commit bfe94c311d
7 changed files with 32 additions and 3 deletions

View File

@@ -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)
{

View File

@@ -645,6 +645,10 @@ function Tabs() //{{{
{ argCount: "0" });
}
completion.addUrlCompleter("t",
"Open tabs",
completion.buffer);
/////////////////////////////////////////////////////////////////////////////}}}
////////////////////// PUBLIC SECTION //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{

View File

@@ -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