mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 08:17:59 +01:00
s/args.arguments/args/g
This commit is contained in:
@@ -115,7 +115,7 @@ function Addressbook() //{{{
|
||||
"Add an address book entry",
|
||||
function (args)
|
||||
{
|
||||
var mailAddr = args.arguments[0]; // TODO: support more than one email address
|
||||
var mailAddr = args[0]; // TODO: support more than one email address
|
||||
var firstName = args["-firstname"] || null;
|
||||
var lastName = args["-lastname"] || null;
|
||||
var displayName = args["-name"] || null;
|
||||
|
||||
@@ -291,8 +291,8 @@ function Bookmarks() //{{{
|
||||
"Add a bookmark",
|
||||
function (args, special)
|
||||
{
|
||||
var url = args.arguments.length == 0 ? buffer.URL : args.arguments[0];
|
||||
var title = args["-title"] || (args.arguments.length == 0 ? buffer.title : null);
|
||||
var url = args.length == 0 ? buffer.URL : args[0];
|
||||
var title = args["-title"] || (args.length == 0 ? buffer.title : null);
|
||||
var keyword = args["-keyword"] || null;
|
||||
var tags = args["-tags"] || [];
|
||||
|
||||
@@ -316,7 +316,7 @@ function Bookmarks() //{{{
|
||||
"List or open multiple bookmarks",
|
||||
function (args, special)
|
||||
{
|
||||
bookmarks.list(args.arguments.join(" "), args["-tags"] || [], special);
|
||||
bookmarks.list(args.join(" "), args["-tags"] || [], special);
|
||||
},
|
||||
{
|
||||
bang: true,
|
||||
|
||||
@@ -532,7 +532,7 @@ function Buffer() //{{{
|
||||
{
|
||||
let doc = window.content.document;
|
||||
let chosenData = null;
|
||||
let filename = args.arguments[0];
|
||||
let filename = args[0];
|
||||
|
||||
if (filename)
|
||||
{
|
||||
@@ -577,7 +577,7 @@ function Buffer() //{{{
|
||||
|
||||
commands.add(["vie[wsource]"],
|
||||
"View source code of current document",
|
||||
function (args, special) { buffer.viewSource(args.arguments[0], special); },
|
||||
function (args, special) { buffer.viewSource(args[0], special); },
|
||||
{
|
||||
argCount: "?",
|
||||
bang: true,
|
||||
@@ -1523,7 +1523,7 @@ function Marks() //{{{
|
||||
"Mark current location within the web page",
|
||||
function (args)
|
||||
{
|
||||
var mark = args.arguments[0];
|
||||
var mark = args[0];
|
||||
if (mark.length > 1)
|
||||
{
|
||||
liberator.echoerr("E488: Trailing characters");
|
||||
|
||||
@@ -186,7 +186,7 @@ function Commands() //{{{
|
||||
let re = RegExp("[" + list + "]", "g");
|
||||
return function (str) q + String.replace(str, re, function ($0, $1) $1 in quoteMap ? quoteMap[$1] : "\\" + $1) + q;
|
||||
}
|
||||
const _quoteArg = { // FIXME
|
||||
const complQuote = { // FIXME
|
||||
'"': ['"', quote("", '\n\t"\\\\'), '"'],
|
||||
"'": ["'", quote("", "\\\\'"), "'"],
|
||||
"": ["", quote("", "\\\\ "), ""]
|
||||
@@ -286,7 +286,7 @@ function Commands() //{{{
|
||||
if (val != null)
|
||||
res.push(quote(val));
|
||||
}
|
||||
for (let [,arg] in Iterator(args.arguments || []))
|
||||
for (let [,arg] in Iterator(args || []))
|
||||
res.push(quote(arg));
|
||||
|
||||
let str = args.literalArg;
|
||||
@@ -452,8 +452,7 @@ function Commands() //{{{
|
||||
if (!argCount)
|
||||
argCount = "*";
|
||||
|
||||
var args = {}; // parsed options
|
||||
args.arguments = []; // remaining arguments
|
||||
var args = []; // parsed options
|
||||
args.string = str; // for access to the unparsed string
|
||||
args.literalArg = "";
|
||||
|
||||
@@ -479,7 +478,7 @@ function Commands() //{{{
|
||||
args.completeOpt = null;
|
||||
args.completeFilter = null;
|
||||
args.completeStart = i;
|
||||
args.quote = _quoteArg[""];
|
||||
args.quote = complQuote[""];
|
||||
}
|
||||
if (complete)
|
||||
{
|
||||
@@ -554,7 +553,7 @@ function Commands() //{{{
|
||||
args.completeStart += optname.length + 1;
|
||||
args.completeOpt = opt;
|
||||
args.completeFilter = arg;
|
||||
args.quote = _quoteArg[quote] || _quoteArg[""];
|
||||
args.quote = complQuote[quote] || complQuote[""];
|
||||
}
|
||||
let type = argTypes[opt[1]];
|
||||
if (type)
|
||||
@@ -599,16 +598,16 @@ function Commands() //{{{
|
||||
|
||||
if (complete)
|
||||
{
|
||||
if (argCount == "0" || args.arguments.length > 0 && (argCount == "1" || argCount == "?"))
|
||||
if (argCount == "0" || args.length > 0 && (argCount == "1" || argCount == "?"))
|
||||
complete.highlight(i, sub.length, "SPELLCHECK")
|
||||
}
|
||||
|
||||
if (literal && args.arguments.length == literalIndex)
|
||||
if (literal && args.length == literalIndex)
|
||||
{
|
||||
args.literalArg = sub;
|
||||
args.arguments.push(sub);
|
||||
args.push(sub);
|
||||
if (complete)
|
||||
args.completeArg = args.arguments.length - 1;
|
||||
args.completeArg = args.length - 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -616,7 +615,7 @@ function Commands() //{{{
|
||||
var [count, arg, quote] = getNextArg(sub);
|
||||
if (complete)
|
||||
{
|
||||
args.quote = _quoteArg[quote] || _quoteArg[""];
|
||||
args.quote = complQuote[quote] || complQuote[""];
|
||||
args.completeFilter = arg || "";
|
||||
}
|
||||
else if (count == -1)
|
||||
@@ -631,9 +630,9 @@ function Commands() //{{{
|
||||
}
|
||||
|
||||
if (arg != null)
|
||||
args.arguments.push(arg);
|
||||
args.push(arg);
|
||||
if (complete)
|
||||
args.completeArg = args.arguments.length - 1;
|
||||
args.completeArg = args.length - 1;
|
||||
|
||||
if (count <= 0)
|
||||
break;
|
||||
@@ -662,15 +661,15 @@ function Commands() //{{{
|
||||
}
|
||||
|
||||
// check for correct number of arguments
|
||||
if (!complete && (args.arguments.length == 0 && /^[1+]$/.test(argCount) ||
|
||||
if (!complete && (args.length == 0 && /^[1+]$/.test(argCount) ||
|
||||
// TODO: what is this for? -- djk
|
||||
literal && argCount == "+" && /^\s*$/.test(args.literalArg)))
|
||||
{
|
||||
liberator.echoerr("E471: Argument required");
|
||||
return null;
|
||||
}
|
||||
else if (args.arguments.length == 1 && (argCount == "0") ||
|
||||
args.arguments.length > 1 && /^[01?]$/.test(argCount))
|
||||
else if (args.length == 1 && (argCount == "0") ||
|
||||
args.length > 1 && /^[01?]$/.test(argCount))
|
||||
{
|
||||
if (!complete)
|
||||
liberator.echoerr("E488: Trailing characters");
|
||||
@@ -776,7 +775,7 @@ function Commands() //{{{
|
||||
"List and define commands",
|
||||
function (args, special)
|
||||
{
|
||||
let cmd = args.arguments[0];
|
||||
let cmd = args[0];
|
||||
|
||||
if (cmd != null && /\W/.test(cmd))
|
||||
{
|
||||
@@ -899,7 +898,7 @@ function Commands() //{{{
|
||||
"Delete the specified user-defined command",
|
||||
function (args)
|
||||
{
|
||||
let name = args.arguments[0];
|
||||
let name = args[0];
|
||||
|
||||
if (commands.get(name))
|
||||
commands.removeUserCommand(name);
|
||||
|
||||
@@ -166,7 +166,7 @@ function Editor() //{{{
|
||||
"Abbreviate a key sequence" + modeDescription,
|
||||
function (args)
|
||||
{
|
||||
let [lhs, rhs] = args.arguments;
|
||||
let [lhs, rhs] = args;
|
||||
if (rhs)
|
||||
editor.addAbbreviation(mode, lhs, rhs);
|
||||
else
|
||||
|
||||
@@ -72,7 +72,7 @@ function AutoCommands() //{{{
|
||||
"Execute commands automatically on events",
|
||||
function (args, special)
|
||||
{
|
||||
let [event, regex, cmd] = args.arguments;
|
||||
let [event, regex, cmd] = args;
|
||||
let events = null;
|
||||
if (event)
|
||||
{
|
||||
@@ -101,7 +101,7 @@ function AutoCommands() //{{{
|
||||
if (special)
|
||||
{
|
||||
// TODO: "*" only appears to work in Vim when there is a {group} specified
|
||||
if (args.arguments[0] != "*" || regex)
|
||||
if (args[0] != "*" || regex)
|
||||
autocommands.remove(event, regex); // remove all
|
||||
}
|
||||
else
|
||||
@@ -725,7 +725,7 @@ function Events() //{{{
|
||||
|
||||
commands.add(["macros"],
|
||||
"List all macros",
|
||||
function (args) { completion.listCompleter("macro", args.arguments[0]) },
|
||||
function (args) { completion.listCompleter("macro", args[0]) },
|
||||
{
|
||||
argCount: "1",
|
||||
completer: function (context) completion.macro(context),
|
||||
@@ -733,7 +733,7 @@ function Events() //{{{
|
||||
|
||||
commands.add(["pl[ay]"],
|
||||
"Replay a recorded macro",
|
||||
function (args) { events.playMacro(args.arguments[0]); },
|
||||
function (args) { events.playMacro(args[0]); },
|
||||
{
|
||||
argCount: "1",
|
||||
completer: function (context) completion.macro(context)
|
||||
|
||||
@@ -244,7 +244,7 @@ function IO() //{{{
|
||||
function (args, special)
|
||||
{
|
||||
// TODO: "E172: Only one file name allowed"
|
||||
let filename = args.arguments[0] || "~/" + (WINDOWS ? "_" : ".") + EXTENSION_NAME + "rc";
|
||||
let filename = args[0] || "~/" + (WINDOWS ? "_" : ".") + EXTENSION_NAME + "rc";
|
||||
let file = io.getFile(filename);
|
||||
|
||||
if (file.exists() && !special)
|
||||
@@ -288,7 +288,7 @@ function IO() //{{{
|
||||
|
||||
commands.add(["runt[ime]"],
|
||||
"Source the specified file from each directory in 'runtimepath'",
|
||||
function (args, special) { io.sourceFromRuntimePath(args.arguments, special); },
|
||||
function (args, special) { io.sourceFromRuntimePath(args, special); },
|
||||
{
|
||||
argCount: "+",
|
||||
bang: true
|
||||
@@ -311,7 +311,7 @@ function IO() //{{{
|
||||
function (args, special)
|
||||
{
|
||||
// FIXME: "E172: Only one file name allowed"
|
||||
io.source(args.arguments[0], special);
|
||||
io.source(args[0], special);
|
||||
},
|
||||
{
|
||||
argCount: "1",
|
||||
|
||||
@@ -183,7 +183,7 @@ const liberator = (function () //{{{
|
||||
"Open a " + config.name + " dialog",
|
||||
function (args)
|
||||
{
|
||||
args = args.arguments[0];
|
||||
args = args[0];
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -685,14 +685,14 @@ function Mail() //{{{
|
||||
function (args)
|
||||
{
|
||||
var mailargs = {};
|
||||
mailargs.to = args.arguments.join(", ");
|
||||
mailargs.to = args.join(", ");
|
||||
mailargs.subject = args["-subject"];
|
||||
mailargs.bcc = args["-bcc"];
|
||||
mailargs.cc = args["-cc"];
|
||||
mailargs.body = args["-text"];
|
||||
mailargs.attachments = args["-attachment"] || [];
|
||||
|
||||
var addresses = args.arguments;
|
||||
var addresses = args;
|
||||
if (mailargs.bcc)
|
||||
addresses = addresses.concat(mailargs.bcc);
|
||||
if (mailargs.cc)
|
||||
|
||||
@@ -151,14 +151,14 @@ function Mappings() //{{{
|
||||
// 2 args -> map arg1 to arg*
|
||||
function map(args, mode, noremap)
|
||||
{
|
||||
if (!args.arguments.length)
|
||||
if (!args.length)
|
||||
{
|
||||
mappings.list(mode);
|
||||
return;
|
||||
}
|
||||
|
||||
// ?:\s+ <- don't remember; (...)? optional = rhs
|
||||
let [lhs, rhs] = args.arguments;
|
||||
let [lhs, rhs] = args;
|
||||
|
||||
if (!rhs) // list the mapping
|
||||
{
|
||||
@@ -224,7 +224,7 @@ function Mappings() //{{{
|
||||
"Remove a mapping" + modeDescription,
|
||||
function (args)
|
||||
{
|
||||
args = args.arguments[0];
|
||||
args = args[0];
|
||||
|
||||
let found = false;
|
||||
for (let [,mode] in Iterator(modes))
|
||||
|
||||
@@ -786,9 +786,9 @@ function Options() //{{{
|
||||
|
||||
//var length = names.length;
|
||||
//for (let i = 0, name = names[i]; i < length; name = names[++i])
|
||||
for (let i = 0; i < args.arguments.length; i++)
|
||||
for (let i = 0; i < args.length; i++)
|
||||
{
|
||||
var name = args.arguments[i];
|
||||
var name = args[i];
|
||||
var reference = liberator.variableReference(name);
|
||||
if (!reference[0])
|
||||
{
|
||||
|
||||
@@ -385,7 +385,7 @@ liberator.registerObserver("load_commands", function ()
|
||||
"Load a color scheme",
|
||||
function (args)
|
||||
{
|
||||
let scheme = args.arguments[0];
|
||||
let scheme = args[0];
|
||||
|
||||
if (io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]))
|
||||
autocommands.trigger("ColorScheme", { name: scheme });
|
||||
@@ -401,7 +401,7 @@ liberator.registerObserver("load_commands", function ()
|
||||
"Add or list user styles",
|
||||
function (args, special)
|
||||
{
|
||||
let [filter, css] = args.arguments;
|
||||
let [filter, css] = args;
|
||||
let name = args["-name"];
|
||||
|
||||
if (!css)
|
||||
@@ -471,7 +471,7 @@ liberator.registerObserver("load_commands", function ()
|
||||
commands.add(["dels[tyle]"],
|
||||
"Remove a user stylesheet",
|
||||
function (args) {
|
||||
styles.removeSheet(args["-name"], args.arguments[0], args.literalArg, args["-index"], false);
|
||||
styles.removeSheet(args["-name"], args[0], args.literalArg, args["-index"], false);
|
||||
},
|
||||
{
|
||||
argCount: 2,
|
||||
@@ -494,7 +494,7 @@ liberator.registerObserver("load_commands", function ()
|
||||
height: 1em !important; min-height: 1em !important; max-height: 1em !important;
|
||||
overflow: hidden !important;
|
||||
]]>;
|
||||
let [key, css] = args.arguments;
|
||||
let [key, css] = args;
|
||||
if (!css && !(key && special))
|
||||
{
|
||||
let str = template.tabular(["Key", "Sample", "CSS"],
|
||||
@@ -521,7 +521,7 @@ liberator.registerObserver("load_commands", function ()
|
||||
context.completions = [[v.class, ""] for (v in highlight)];
|
||||
else if (args.completeArg == 1)
|
||||
{
|
||||
let hl = highlight.get(args.arguments[0]);
|
||||
let hl = highlight.get(args[0]);
|
||||
if (hl)
|
||||
context.completions = [[hl.value, "Current Value"], [hl.default || "", "Default Value"]];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user