1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 14:12:27 +01:00

declare some undeclared variables in parseOpt and whitespace fixes

This commit is contained in:
Doug Kearns
2008-10-15 01:55:27 +00:00
parent 7770adb4af
commit 1394f483e4
11 changed files with 30 additions and 24 deletions

View File

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

View File

@@ -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]"],

View File

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

View File

@@ -866,12 +866,17 @@ function Completion() //{{{
return mapped; return mapped;
}; };
try { try
{
if (tail) if (tail)
return [dir.length, this.cached("file-" + dir, compl, generate, "filter", [true])]; return [dir.length, this.cached("file-" + dir, compl, generate, "filter", [true])];
else else
return [0, this.cached("file", filter, generate, "filter", [true])]; return [0, this.cached("file", filter, generate, "filter", [true])];
}catch(e){liberator.dump(e)} }
catch (e)
{
liberator.dump(e);
}
}, },
help: function help(filter) help: function help(filter)

View File

@@ -221,7 +221,7 @@ function Search() //{{{
aNode.appendChild(docfrag); aNode.appendChild(docfrag);
parent.insertBefore(aNode, before); parent.insertBefore(aNode, before);
return aNode; return aNode;
}, }
}; };
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}

View File

@@ -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"],

View File

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

View File

@@ -231,6 +231,6 @@ const template = {
</tr>) </tr>)
} }
</table>); </table>);
}, }
}; };

View File

@@ -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]);

View File

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