mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 09:48:00 +01:00
declare some undeclared variables in parseOpt and whitespace fixes
This commit is contained in:
@@ -520,7 +520,7 @@ function Bookmarks() //{{{
|
|||||||
].filter(function (i) i[1])
|
].filter(function (i) i[1])
|
||||||
} for each (item in items)));
|
} for each (item in items)));
|
||||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
//}}}
|
//}}}
|
||||||
}; //}}}
|
}; //}}}
|
||||||
@@ -816,7 +816,7 @@ function History() //{{{
|
|||||||
let list = template.bookmarks("title", (
|
let list = template.bookmarks("title", (
|
||||||
{
|
{
|
||||||
title: item[1],
|
title: item[1],
|
||||||
url: item[0],
|
url: item[0]
|
||||||
} for each (item in items)));
|
} for each (item in items)));
|
||||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ function Buffer() //{{{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Styles.prototype = {
|
Styles.prototype = {
|
||||||
get sites() util.uniq(util.flatten([v.sites for ([k, v] in this.userSheets)])),
|
get sites() util.uniq(util.flatten([v.sites for ([k, v] in this.userSheets)]))
|
||||||
};
|
};
|
||||||
|
|
||||||
let styles = storage.newObject("styles", Styles, false);
|
let styles = storage.newObject("styles", Styles, false);
|
||||||
@@ -887,7 +887,7 @@ function Buffer() //{{{
|
|||||||
, filter)],
|
, filter)],
|
||||||
literal: true,
|
literal: true,
|
||||||
options: [[["-index", "-i"], commands.OPTION_INT],
|
options: [[["-index", "-i"], commands.OPTION_INT],
|
||||||
[["-name", "-n"], commands.OPTION_STRING]],
|
[["-name", "-n"], commands.OPTION_STRING]]
|
||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["hi[ghlight]"],
|
commands.add(["hi[ghlight]"],
|
||||||
@@ -915,7 +915,7 @@ function Buffer() //{{{
|
|||||||
argCount: 1,
|
argCount: 1,
|
||||||
bang: true,
|
bang: true,
|
||||||
hereDoc: true,
|
hereDoc: true,
|
||||||
literal: true,
|
literal: true
|
||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["vie[wsource]"],
|
commands.add(["vie[wsource]"],
|
||||||
|
|||||||
@@ -532,7 +532,7 @@ function Commands() //{{{
|
|||||||
invalid = true;
|
invalid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quote)
|
if (quote)
|
||||||
{
|
{
|
||||||
if (!complete)
|
if (!complete)
|
||||||
{
|
{
|
||||||
@@ -748,7 +748,7 @@ function Commands() //{{{
|
|||||||
let filter = {
|
let filter = {
|
||||||
argCount: args["-nargs"],
|
argCount: args["-nargs"],
|
||||||
bang: "-bang" in args && true,
|
bang: "-bang" in args && true,
|
||||||
count: args["-count"],
|
count: args["-count"]
|
||||||
};
|
};
|
||||||
let cmds = getMatchingUserCommands(cmd, filter);
|
let cmds = getMatchingUserCommands(cmd, filter);
|
||||||
|
|
||||||
|
|||||||
@@ -866,12 +866,17 @@ function Completion() //{{{
|
|||||||
return mapped;
|
return mapped;
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try
|
||||||
if (tail)
|
{
|
||||||
return [dir.length, this.cached("file-" + dir, compl, generate, "filter", [true])];
|
if (tail)
|
||||||
else
|
return [dir.length, this.cached("file-" + dir, compl, generate, "filter", [true])];
|
||||||
return [0, this.cached("file", filter, generate, "filter", [true])];
|
else
|
||||||
}catch(e){liberator.dump(e)}
|
return [0, this.cached("file", filter, generate, "filter", [true])];
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
liberator.dump(e);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
help: function help(filter)
|
help: function help(filter)
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ function Search() //{{{
|
|||||||
aNode.appendChild(docfrag);
|
aNode.appendChild(docfrag);
|
||||||
parent.insertBefore(aNode, before);
|
parent.insertBefore(aNode, before);
|
||||||
return aNode;
|
return aNode;
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////}}}
|
/////////////////////////////////////////////////////////////////////////////}}}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
function load(script) {
|
function load(script) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dump("liberator: Loading script: " + script + "\n");
|
dump("liberator: Loading script: " + script + "\n");
|
||||||
loader.loadSubScript(BASE + script, modules)
|
loader.loadSubScript(BASE + script, modules)
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ const liberator = (function () //{{{
|
|||||||
["b", "Bookmark bar"]
|
["b", "Bookmark bar"]
|
||||||
].concat(!liberator.has("tabs") ? [] : tabopts);
|
].concat(!liberator.has("tabs") ? [] : tabopts);
|
||||||
},
|
},
|
||||||
validator: function (value) Array.every(value, function (c) c in config.guioptions || tabopts.some(function (a) a[0] == c)),
|
validator: function (value) Array.every(value, function (c) c in config.guioptions || tabopts.some(function (a) a[0] == c))
|
||||||
});
|
});
|
||||||
|
|
||||||
options.add(["helpfile", "hf"],
|
options.add(["helpfile", "hf"],
|
||||||
@@ -333,7 +333,7 @@ const liberator = (function () //{{{
|
|||||||
{
|
{
|
||||||
bang: true,
|
bang: true,
|
||||||
completer: function (filter) completion.javascript(filter),
|
completer: function (filter) completion.javascript(filter),
|
||||||
hereDoc: true,
|
hereDoc: true
|
||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["loadplugins", "lpl"],
|
commands.add(["loadplugins", "lpl"],
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ function Options() //{{{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
argCount: "0",
|
argCount: "0",
|
||||||
bang: true,
|
bang: true
|
||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["setl[ocal]"],
|
commands.add(["setl[ocal]"],
|
||||||
@@ -419,6 +419,7 @@ function Options() //{{{
|
|||||||
function parseOpt(args, modifiers)
|
function parseOpt(args, modifiers)
|
||||||
{
|
{
|
||||||
let ret = {};
|
let ret = {};
|
||||||
|
let matches, prefix, postfix, valueGiven;
|
||||||
|
|
||||||
[matches, prefix, ret.name, postfix, valueGiven, ret.operator, ret.value] =
|
[matches, prefix, ret.name, postfix, valueGiven, ret.operator, ret.value] =
|
||||||
args.match(/^\s*(no|inv)?([a-z_]+)([?&!])?\s*(([-+^]?)=(.*))?\s*$/) || [];
|
args.match(/^\s*(no|inv)?([a-z_]+)([?&!])?\s*(([-+^]?)=(.*))?\s*$/) || [];
|
||||||
@@ -893,7 +894,7 @@ function Options() //{{{
|
|||||||
name: opt.name,
|
name: opt.name,
|
||||||
default: opt.defaultValue,
|
default: opt.defaultValue,
|
||||||
pre: "\u00a0\u00a0", /* Unicode nonbreaking space. */
|
pre: "\u00a0\u00a0", /* Unicode nonbreaking space. */
|
||||||
value: <></>,
|
value: <></>
|
||||||
};
|
};
|
||||||
|
|
||||||
if (onlyNonDefault && option.isDefault)
|
if (onlyNonDefault && option.isDefault)
|
||||||
@@ -942,7 +943,7 @@ function Options() //{{{
|
|||||||
default: loadPreference(pref, null, true),
|
default: loadPreference(pref, null, true),
|
||||||
value: <>={template.highlight(value)}</>,
|
value: <>={template.highlight(value)}</>,
|
||||||
name: pref,
|
name: pref,
|
||||||
pre: "\u00a0\u00a0", /* Unicode nonbreaking space. */
|
pre: "\u00a0\u00a0" /* Unicode nonbreaking space. */
|
||||||
};
|
};
|
||||||
|
|
||||||
yield option;
|
yield option;
|
||||||
|
|||||||
@@ -231,6 +231,6 @@ const template = {
|
|||||||
</tr>)
|
</tr>)
|
||||||
}
|
}
|
||||||
</table>);
|
</table>);
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1493,7 +1493,7 @@ function StatusLine() //{{{
|
|||||||
const highlightGroup = {
|
const highlightGroup = {
|
||||||
secure: "StatusLineSecure",
|
secure: "StatusLineSecure",
|
||||||
broken: "StatusLineBroken",
|
broken: "StatusLineBroken",
|
||||||
insecure: "StatusLine",
|
insecure: "StatusLine"
|
||||||
};
|
};
|
||||||
|
|
||||||
statusBar.setAttribute("class", "chromeclass-status hl-" + highlightGroup[type]);
|
statusBar.setAttribute("class", "chromeclass-status hl-" + highlightGroup[type]);
|
||||||
|
|||||||
@@ -436,7 +436,7 @@ const util = { //{{{
|
|||||||
domnode.appendChild(arguments.callee(child, doc));
|
domnode.appendChild(arguments.callee(child, doc));
|
||||||
return domnode;
|
return domnode;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}; //}}}
|
}; //}}}
|
||||||
|
|
||||||
function Struct()
|
function Struct()
|
||||||
@@ -466,7 +466,7 @@ function Struct()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Struct.prototype = {
|
Struct.prototype = {
|
||||||
clone: function ()
|
clone: function ()
|
||||||
{
|
{
|
||||||
return this.constructor.apply(null, this.slice());
|
return this.constructor.apply(null, this.slice());
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user