mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 22:38:00 +01:00
Formatting fixes.
This commit is contained in:
@@ -92,9 +92,9 @@ function Bookmarks() //{{{
|
|||||||
this.__defineGetter__("bookmarks", function () this.load());
|
this.__defineGetter__("bookmarks", function () this.load());
|
||||||
|
|
||||||
this.__defineGetter__("keywords",
|
this.__defineGetter__("keywords",
|
||||||
function () [new Keyword(k.keyword, k.title, k.icon, k.url) for ([,k] in Iterator(self.bookmarks)) if (k.keyword)]);
|
function () [new Keyword(k.keyword, k.title, k.icon, k.url) for ([, k] in Iterator(self.bookmarks)) if (k.keyword)]);
|
||||||
|
|
||||||
this.__iterator__ = function () (val for ([,val] in Iterator(self.bookmarks)));
|
this.__iterator__ = function () (val for ([, val] in Iterator(self.bookmarks)));
|
||||||
|
|
||||||
function loadBookmark(node)
|
function loadBookmark(node)
|
||||||
{
|
{
|
||||||
@@ -502,7 +502,7 @@ function Bookmarks() //{{{
|
|||||||
let engine = services.get("browserSearch").getEngineByAlias(name);
|
let engine = services.get("browserSearch").getEngineByAlias(name);
|
||||||
if (!engine)
|
if (!engine)
|
||||||
return;
|
return;
|
||||||
let [,word] = /^\s*(\S+)/.exec(context.filter) || [];
|
let [, word] = /^\s*(\S+)/.exec(context.filter) || [];
|
||||||
if (!kludge && word == name) // FIXME: Check for matching keywords
|
if (!kludge && word == name) // FIXME: Check for matching keywords
|
||||||
return;
|
return;
|
||||||
let ctxt = context.fork(name, 0);
|
let ctxt = context.fork(name, 0);
|
||||||
@@ -654,7 +654,7 @@ function Bookmarks() //{{{
|
|||||||
getSearchEngines: function getSearchEngines()
|
getSearchEngines: function getSearchEngines()
|
||||||
{
|
{
|
||||||
let searchEngines = [];
|
let searchEngines = [];
|
||||||
for (let [,engine] in Iterator(services.get("browserSearch").getVisibleEngines({})))
|
for (let [, engine] in Iterator(services.get("browserSearch").getVisibleEngines({})))
|
||||||
{
|
{
|
||||||
let alias = engine.alias;
|
let alias = engine.alias;
|
||||||
if (!alias || !/^[a-z0-9_-]+$/.test(alias))
|
if (!alias || !/^[a-z0-9_-]+$/.test(alias))
|
||||||
|
|||||||
@@ -774,7 +774,7 @@ function Buffer() //{{{
|
|||||||
|
|
||||||
// put feeds rss into pageFeeds[]
|
// put feeds rss into pageFeeds[]
|
||||||
let nFeed = 0;
|
let nFeed = 0;
|
||||||
for (let [,link] in Iterator(doc.getElementsByTagName("link")))
|
for (let [, link] in Iterator(doc.getElementsByTagName("link")))
|
||||||
{
|
{
|
||||||
if (!link.href)
|
if (!link.href)
|
||||||
return;
|
return;
|
||||||
@@ -1167,7 +1167,7 @@ function Buffer() //{{{
|
|||||||
|
|
||||||
// TODO: this should probably use the default 'hinttags' value. --djk
|
// TODO: this should probably use the default 'hinttags' value. --djk
|
||||||
let res = buffer.evaluateXPath(options["hinttags"], frame.document);
|
let res = buffer.evaluateXPath(options["hinttags"], frame.document);
|
||||||
for (let [,regex] in Iterator(regexes))
|
for (let [, regex] in Iterator(regexes))
|
||||||
{
|
{
|
||||||
for (let i in util.range(res.snapshotLength, 0, -1))
|
for (let i in util.range(res.snapshotLength, 0, -1))
|
||||||
{
|
{
|
||||||
@@ -1697,7 +1697,7 @@ function Marks() //{{{
|
|||||||
function localMarkIter()
|
function localMarkIter()
|
||||||
{
|
{
|
||||||
for (let [mark, value] in localMarks)
|
for (let [mark, value] in localMarks)
|
||||||
for (let [,val] in Iterator(value))
|
for (let [, val] in Iterator(value))
|
||||||
yield [mark, val];
|
yield [mark, val];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1825,7 +1825,7 @@ function Marks() //{{{
|
|||||||
|
|
||||||
// FIXME: Line/Column doesn't make sense with %
|
// FIXME: Line/Column doesn't make sense with %
|
||||||
context.title = ["Mark", "Line Column File"];
|
context.title = ["Mark", "Line Column File"];
|
||||||
context.keys.description = function ([,m]) percent(m.position.y) + "% " + percent(m.position.x) + "% " + m.location;
|
context.keys.description = function ([, m]) percent(m.position.y) + "% " + percent(m.position.x) + "% " + m.location;
|
||||||
context.completions = marks.all;
|
context.completions = marks.all;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1965,7 +1965,7 @@ function Marks() //{{{
|
|||||||
let win = window.content;
|
let win = window.content;
|
||||||
let slice = localMarks.get(mark) || [];
|
let slice = localMarks.get(mark) || [];
|
||||||
|
|
||||||
for (let [,lmark] in Iterator(slice))
|
for (let [, lmark] in Iterator(slice))
|
||||||
{
|
{
|
||||||
if (win.location.href == lmark.location)
|
if (win.location.href == lmark.location)
|
||||||
{
|
{
|
||||||
@@ -2006,7 +2006,7 @@ function Marks() //{{{
|
|||||||
Math.round(mark[1].position.x * 100) + "%",
|
Math.round(mark[1].position.x * 100) + "%",
|
||||||
Math.round(mark[1].position.y * 100) + "%",
|
Math.round(mark[1].position.y * 100) + "%",
|
||||||
mark[1].location]
|
mark[1].location]
|
||||||
for ([,mark] in Iterator(marks))));
|
for ([, mark] in Iterator(marks))));
|
||||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ function Command(specs, description, action, extraInfo) //{{{
|
|||||||
let longNames = [];
|
let longNames = [];
|
||||||
let shortNames = [];
|
let shortNames = [];
|
||||||
|
|
||||||
for (let [,spec] in Iterator(specs))
|
for (let [, spec] in Iterator(specs))
|
||||||
{
|
{
|
||||||
let matches = spec.match(/(\w+)\[(\w+)\](\w*)/);
|
let matches = spec.match(/(\w+)\[(\w+)\](\w*)/);
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ Command.prototype = {
|
|||||||
*/
|
*/
|
||||||
hasName: function (name)
|
hasName: function (name)
|
||||||
{
|
{
|
||||||
for (let [,spec] in Iterator(this.specs))
|
for (let [, spec] in Iterator(this.specs))
|
||||||
{
|
{
|
||||||
let fullName = spec.replace(/\[(\w+)]$/, "$1");
|
let fullName = spec.replace(/\[(\w+)]$/, "$1");
|
||||||
let index = spec.indexOf("[");
|
let index = spec.indexOf("[");
|
||||||
@@ -515,7 +515,7 @@ function Commands() //{{{
|
|||||||
opt += char + quote(val)
|
opt += char + quote(val)
|
||||||
res.push(opt);
|
res.push(opt);
|
||||||
}
|
}
|
||||||
for (let [,arg] in Iterator(args.arguments || []))
|
for (let [, arg] in Iterator(args.arguments || []))
|
||||||
res.push(quote(arg));
|
res.push(quote(arg));
|
||||||
|
|
||||||
let str = args.literalArg;
|
let str = args.literalArg;
|
||||||
@@ -712,9 +712,9 @@ function Commands() //{{{
|
|||||||
var optname = "";
|
var optname = "";
|
||||||
if (!onlyArgumentsRemaining)
|
if (!onlyArgumentsRemaining)
|
||||||
{
|
{
|
||||||
for (let [,opt] in Iterator(options))
|
for (let [, opt] in Iterator(options))
|
||||||
{
|
{
|
||||||
for (let [,optname] in Iterator(opt[0]))
|
for (let [, optname] in Iterator(opt[0]))
|
||||||
{
|
{
|
||||||
if (sub.indexOf(optname) == 0)
|
if (sub.indexOf(optname) == 0)
|
||||||
{
|
{
|
||||||
@@ -1107,7 +1107,7 @@ function Commands() //{{{
|
|||||||
cmd.count ? "0c" : "",
|
cmd.count ? "0c" : "",
|
||||||
completerToString(cmd.completer),
|
completerToString(cmd.completer),
|
||||||
cmd.replacementText || "function () { ... }"]
|
cmd.replacementText || "function () { ... }"]
|
||||||
for ([,cmd] in Iterator(cmds))));
|
for ([, cmd] in Iterator(cmds))));
|
||||||
|
|
||||||
commandline.echo(str, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(str, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ CompletionContext.prototype = {
|
|||||||
|
|
||||||
cancelAll: function ()
|
cancelAll: function ()
|
||||||
{
|
{
|
||||||
for (let [,context] in Iterator(this.contextList))
|
for (let [, context] in Iterator(this.contextList))
|
||||||
{
|
{
|
||||||
if (context.cancel)
|
if (context.cancel)
|
||||||
context.cancel();
|
context.cancel();
|
||||||
@@ -1006,7 +1006,7 @@ function Completion() //{{{
|
|||||||
// Find any complete statements that we can eval before we eval our object.
|
// Find any complete statements that we can eval before we eval our object.
|
||||||
// This allows for things like: let doc = window.content.document; let elem = doc.createElement...; elem.<Tab>
|
// This allows for things like: let doc = window.content.document; let elem = doc.createElement...; elem.<Tab>
|
||||||
let prev = 0;
|
let prev = 0;
|
||||||
for (let [,v] in Iterator(get(0)[FULL_STATEMENTS]))
|
for (let [, v] in Iterator(get(0)[FULL_STATEMENTS]))
|
||||||
{
|
{
|
||||||
let key = str.substring(prev, v + 1);
|
let key = str.substring(prev, v + 1);
|
||||||
if (checkFunction(prev, v, key))
|
if (checkFunction(prev, v, key))
|
||||||
@@ -1123,14 +1123,14 @@ function Completion() //{{{
|
|||||||
}
|
}
|
||||||
// TODO: Make this a generic completion helper function.
|
// TODO: Make this a generic completion helper function.
|
||||||
let filter = key + (string || "");
|
let filter = key + (string || "");
|
||||||
for (let [,obj] in Iterator(objects))
|
for (let [, obj] in Iterator(objects))
|
||||||
{
|
{
|
||||||
this.context.fork(obj[1], top[OFFSET], this, fill,
|
this.context.fork(obj[1], top[OFFSET], this, fill,
|
||||||
obj[0], obj[1], compl, compl != orig, filter, last, key.length);
|
obj[0], obj[1], compl, compl != orig, filter, last, key.length);
|
||||||
}
|
}
|
||||||
if (orig)
|
if (orig)
|
||||||
return;
|
return;
|
||||||
for (let [,obj] in Iterator(objects))
|
for (let [, obj] in Iterator(objects))
|
||||||
{
|
{
|
||||||
obj[1] += " (substrings)";
|
obj[1] += " (substrings)";
|
||||||
this.context.fork(obj[1], top[OFFSET], this, fill,
|
this.context.fork(obj[1], top[OFFSET], this, fill,
|
||||||
@@ -1283,7 +1283,7 @@ function Completion() //{{{
|
|||||||
setFunctionCompleter: function setFunctionCompleter(funcs, completers)
|
setFunctionCompleter: function setFunctionCompleter(funcs, completers)
|
||||||
{
|
{
|
||||||
funcs = Array.concat(funcs);
|
funcs = Array.concat(funcs);
|
||||||
for (let [,func] in Iterator(funcs))
|
for (let [, func] in Iterator(funcs))
|
||||||
{
|
{
|
||||||
func.liberatorCompleter = function liberatorCompleter(context, func, obj, args) {
|
func.liberatorCompleter = function liberatorCompleter(context, func, obj, args) {
|
||||||
let completer = completers[args.length - 1];
|
let completer = completers[args.length - 1];
|
||||||
|
|||||||
@@ -78,12 +78,12 @@ function Editor() //{{{
|
|||||||
let keyword = "[^" + nonkw + "]";
|
let keyword = "[^" + nonkw + "]";
|
||||||
let nonkeyword = "[" + nonkw + "]";
|
let nonkeyword = "[" + nonkw + "]";
|
||||||
|
|
||||||
let full_id = keyword + "+";
|
let fullId = keyword + "+";
|
||||||
let end_id = nonkeyword + "+" + keyword;
|
let endId = nonkeyword + "+" + keyword;
|
||||||
let non_id = "\\S*" + nonkeyword;
|
let nonId = "\\S*" + nonkeyword;
|
||||||
|
|
||||||
// Used in addAbbrevation and expandAbbreviation
|
// Used in addAbbrevation and expandAbbreviation
|
||||||
var abbrevmatch = full_id + "|" + end_id + "|" + non_id;
|
var abbrevmatch = fullId + "|" + endId + "|" + nonId;
|
||||||
|
|
||||||
function getEditor() liberator.focus;
|
function getEditor() liberator.focus;
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ function Editor() //{{{
|
|||||||
function abbrevs()
|
function abbrevs()
|
||||||
{
|
{
|
||||||
for (let [lhs, abbr] in Iterator(abbreviations))
|
for (let [lhs, abbr] in Iterator(abbreviations))
|
||||||
for (let [,rhs] in Iterator(abbr))
|
for (let [, rhs] in Iterator(abbr))
|
||||||
yield [lhs, rhs];
|
yield [lhs, rhs];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ function Editor() //{{{
|
|||||||
liberator.echoerr("E474: Invalid argument");
|
liberator.echoerr("E474: Invalid argument");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let [,lhs,rhs] = matches;
|
let [, lhs, rhs] = matches;
|
||||||
if (rhs)
|
if (rhs)
|
||||||
editor.addAbbreviation(mode, lhs, rhs);
|
editor.addAbbreviation(mode, lhs, rhs);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ function AutoCommands() //{{{
|
|||||||
let lastPattern = null;
|
let lastPattern = null;
|
||||||
let url = args.url || "";
|
let url = args.url || "";
|
||||||
|
|
||||||
for (let [,autoCmd] in Iterator(autoCmds))
|
for (let [, autoCmd] in Iterator(autoCmds))
|
||||||
{
|
{
|
||||||
if (autoCmd.pattern.test(url))
|
if (autoCmd.pattern.test(url))
|
||||||
{
|
{
|
||||||
@@ -472,7 +472,7 @@ function Events() //{{{
|
|||||||
if (k in keyTable)
|
if (k in keyTable)
|
||||||
names = keyTable[k];
|
names = keyTable[k];
|
||||||
code_key[v] = names[0];
|
code_key[v] = names[0];
|
||||||
for (let [,name] in Iterator(names))
|
for (let [, name] in Iterator(names))
|
||||||
key_code[name.toLowerCase()] = v;
|
key_code[name.toLowerCase()] = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -581,7 +581,7 @@ function Events() //{{{
|
|||||||
|
|
||||||
if (dirs.length > 0)
|
if (dirs.length > 0)
|
||||||
{
|
{
|
||||||
for (let [,dir] in Iterator(dirs))
|
for (let [, dir] in Iterator(dirs))
|
||||||
{
|
{
|
||||||
liberator.echomsg('Searching for "macros/*" in "' + dir.path + '"', 2);
|
liberator.echomsg('Searching for "macros/*" in "' + dir.path + '"', 2);
|
||||||
|
|
||||||
@@ -882,7 +882,7 @@ function Events() //{{{
|
|||||||
{
|
{
|
||||||
liberator.threadYield(1, true);
|
liberator.threadYield(1, true);
|
||||||
|
|
||||||
for (let [,evt_obj] in Iterator(events.fromString(keys)))
|
for (let [, evt_obj] in Iterator(events.fromString(keys)))
|
||||||
{
|
{
|
||||||
let elem = liberator.focus || window.content;
|
let elem = liberator.focus || window.content;
|
||||||
let evt = events.create(doc, "keypress", evt_obj);
|
let evt = events.create(doc, "keypress", evt_obj);
|
||||||
@@ -922,7 +922,7 @@ function Events() //{{{
|
|||||||
{
|
{
|
||||||
let duringFeed = this.duringFeed;
|
let duringFeed = this.duringFeed;
|
||||||
this.duringFeed = [];
|
this.duringFeed = [];
|
||||||
for (let [,evt] in Iterator(duringFeed))
|
for (let [, evt] in Iterator(duringFeed))
|
||||||
evt.target.dispatchEvent(evt);
|
evt.target.dispatchEvent(evt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1021,8 +1021,8 @@ function Events() //{{{
|
|||||||
while (match = re.exec(input))
|
while (match = re.exec(input))
|
||||||
{
|
{
|
||||||
let evt_str = match[0];
|
let evt_str = match[0];
|
||||||
let evt_obj = {ctrlKey:false, shiftKey:false,altKey:false, metaKey: false,
|
let evt_obj = { ctrlKey: false, shiftKey: false, altKey: false, metaKey: false,
|
||||||
keyCode: 0, charCode: 0, type: "keypress"};
|
keyCode: 0, charCode: 0, type: "keypress" };
|
||||||
|
|
||||||
if (evt_str.length > 1) // <.*?>
|
if (evt_str.length > 1) // <.*?>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ function Hints() //{{{
|
|||||||
w: Mode("Follow hint in a new window", function (elem) buffer.followLink(elem, liberator.NEW_WINDOW), extended),
|
w: Mode("Follow hint in a new window", function (elem) buffer.followLink(elem, liberator.NEW_WINDOW), extended),
|
||||||
F: Mode("Open multiple hints in tabs", followAndReshow),
|
F: Mode("Open multiple hints in tabs", followAndReshow),
|
||||||
O: Mode("Generate an ':open URL' using hint", function (elem, loc) commandline.open(":", "open " + loc, modes.EX)),
|
O: Mode("Generate an ':open URL' using hint", function (elem, loc) commandline.open(":", "open " + loc, modes.EX)),
|
||||||
T: Mode("Generate a ':tabopen URL' using hint",function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX)),
|
T: Mode("Generate a ':tabopen URL' using hint", function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX)),
|
||||||
W: Mode("Generate a ':winopen URL' using hint",function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX)),
|
W: Mode("Generate a ':winopen URL' using hint", function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX)),
|
||||||
v: Mode("View hint source", function (elem, loc) buffer.viewSource(loc, false), extended),
|
v: Mode("View hint source", function (elem, loc) buffer.viewSource(loc, false), extended),
|
||||||
V: Mode("View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true), extended),
|
V: Mode("View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true), extended),
|
||||||
y: Mode("Yank hint location", function (elem, loc) util.copyToClipboard(loc, true)),
|
y: Mode("Yank hint location", function (elem, loc) util.copyToClipboard(loc, true)),
|
||||||
@@ -163,7 +163,7 @@ function Hints() //{{{
|
|||||||
return [elem.value, false];
|
return [elem.value, false];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (let [,option] in Iterator(options["hintinputs"].split(",")))
|
for (let [, option] in Iterator(options["hintinputs"].split(",")))
|
||||||
{
|
{
|
||||||
if (option == "value")
|
if (option == "value")
|
||||||
{
|
{
|
||||||
@@ -435,7 +435,7 @@ function Hints() //{{{
|
|||||||
setClass(imgspan, activeHint == hintnum);
|
setClass(imgspan, activeHint == hintnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
span.setAttribute("number", showtext ? hintnum + ": " + text.substr(0,50): hintnum);
|
span.setAttribute("number", showtext ? hintnum + ": " + text.substr(0, 50) : hintnum);
|
||||||
if (imgspan)
|
if (imgspan)
|
||||||
imgspan.setAttribute("number", hintnum);
|
imgspan.setAttribute("number", hintnum);
|
||||||
else
|
else
|
||||||
@@ -712,7 +712,7 @@ function Hints() //{{{
|
|||||||
function stringsAtBeginningOfWords(strings, words, allowWordOverleaping)
|
function stringsAtBeginningOfWords(strings, words, allowWordOverleaping)
|
||||||
{
|
{
|
||||||
let strIdx = 0;
|
let strIdx = 0;
|
||||||
for (let [,word] in Iterator(words))
|
for (let [, word] in Iterator(words))
|
||||||
{
|
{
|
||||||
if (word.length == 0)
|
if (word.length == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ function Script(file)
|
|||||||
this.__context__ = this;
|
this.__context__ = this;
|
||||||
|
|
||||||
// This belongs elsewhere
|
// This belongs elsewhere
|
||||||
for (let [,dir] in Iterator(io.getRuntimeDirectories("plugin")))
|
for (let [, dir] in Iterator(io.getRuntimeDirectories("plugin")))
|
||||||
{
|
{
|
||||||
if (dir.contains(file, false))
|
if (dir.contains(file, false))
|
||||||
plugins[this.NAME] = this;
|
plugins[this.NAME] = this;
|
||||||
@@ -230,7 +230,7 @@ function IO() //{{{
|
|||||||
let dirs = getPathsFromPathList(options["cdpath"]);
|
let dirs = getPathsFromPathList(options["cdpath"]);
|
||||||
let found = false;
|
let found = false;
|
||||||
|
|
||||||
for (let [,dir] in Iterator(dirs))
|
for (let [, dir] in Iterator(dirs))
|
||||||
{
|
{
|
||||||
dir = joinPaths(dir, arg);
|
dir = joinPaths(dir, arg);
|
||||||
|
|
||||||
@@ -467,7 +467,7 @@ function IO() //{{{
|
|||||||
let dirNames = services.get("environment").get("PATH").split(RegExp(liberator.has("Win32") ? ";" : ":"));
|
let dirNames = services.get("environment").get("PATH").split(RegExp(liberator.has("Win32") ? ";" : ":"));
|
||||||
let commands = [];
|
let commands = [];
|
||||||
|
|
||||||
for (let [,dirName] in Iterator(dirNames))
|
for (let [, dirName] in Iterator(dirNames))
|
||||||
{
|
{
|
||||||
let dir = io.getFile(dirName);
|
let dir = io.getFile(dirName);
|
||||||
if (dir.exists() && dir.isDirectory())
|
if (dir.exists() && dir.isDirectory())
|
||||||
@@ -884,7 +884,7 @@ function IO() //{{{
|
|||||||
dirs = [io.getCurrentDirectory().path].concat(dirs);
|
dirs = [io.getCurrentDirectory().path].concat(dirs);
|
||||||
|
|
||||||
lookup:
|
lookup:
|
||||||
for (let [,dir] in Iterator(dirs))
|
for (let [, dir] in Iterator(dirs))
|
||||||
{
|
{
|
||||||
file = joinPaths(dir, program);
|
file = joinPaths(dir, program);
|
||||||
try
|
try
|
||||||
@@ -897,7 +897,7 @@ lookup:
|
|||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
{
|
{
|
||||||
let extensions = services.get("environment").get("PATHEXT").split(";");
|
let extensions = services.get("environment").get("PATHEXT").split(";");
|
||||||
for (let [,extension] in Iterator(extensions))
|
for (let [, extension] in Iterator(extensions))
|
||||||
{
|
{
|
||||||
file = joinPaths(dir, program + extension);
|
file = joinPaths(dir, program + extension);
|
||||||
if (file.exists())
|
if (file.exists())
|
||||||
@@ -942,9 +942,9 @@ lookup:
|
|||||||
liberator.echomsg("Searching for \"" + paths.join(" ") + "\" in \"" + options["runtimepath"] + "\"", 2);
|
liberator.echomsg("Searching for \"" + paths.join(" ") + "\" in \"" + options["runtimepath"] + "\"", 2);
|
||||||
|
|
||||||
outer:
|
outer:
|
||||||
for (let [,dir] in Iterator(dirs))
|
for (let [, dir] in Iterator(dirs))
|
||||||
{
|
{
|
||||||
for (let [,path] in Iterator(paths))
|
for (let [, path] in Iterator(paths))
|
||||||
{
|
{
|
||||||
let file = joinPaths(dir, path);
|
let file = joinPaths(dir, path);
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ const liberator = (function () //{{{
|
|||||||
{
|
{
|
||||||
function addChildren(node, parent)
|
function addChildren(node, parent)
|
||||||
{
|
{
|
||||||
for (let [,item] in Iterator(node.childNodes))
|
for (let [, item] in Iterator(node.childNodes))
|
||||||
{
|
{
|
||||||
if (item.childNodes.length == 0 && item.localName == "menuitem"
|
if (item.childNodes.length == 0 && item.localName == "menuitem"
|
||||||
&& !/rdf:http:/.test(item.getAttribute("label"))) // FIXME
|
&& !/rdf:http:/.test(item.getAttribute("label"))) // FIXME
|
||||||
@@ -163,7 +163,7 @@ const liberator = (function () //{{{
|
|||||||
opts: config.guioptions,
|
opts: config.guioptions,
|
||||||
setter: function (opts)
|
setter: function (opts)
|
||||||
{
|
{
|
||||||
for (let [opt, [,ids]] in Iterator(this.opts))
|
for (let [opt, [, ids]] in Iterator(this.opts))
|
||||||
{
|
{
|
||||||
ids.map(function (id) document.getElementById(id))
|
ids.map(function (id) document.getElementById(id))
|
||||||
.forEach(function (elem)
|
.forEach(function (elem)
|
||||||
@@ -220,7 +220,7 @@ const liberator = (function () //{{{
|
|||||||
{
|
{
|
||||||
setter: function (value)
|
setter: function (value)
|
||||||
{
|
{
|
||||||
for (let [,group] in Iterator(groups))
|
for (let [, group] in Iterator(groups))
|
||||||
group.setter(value);
|
group.setter(value);
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
@@ -351,7 +351,7 @@ const liberator = (function () //{{{
|
|||||||
// TODO: why are these sorts of properties arrays? --djk
|
// TODO: why are these sorts of properties arrays? --djk
|
||||||
let dialogs = config.dialogs;
|
let dialogs = config.dialogs;
|
||||||
|
|
||||||
for (let [,dialog] in Iterator(dialogs))
|
for (let [, dialog] in Iterator(dialogs))
|
||||||
{
|
{
|
||||||
if (util.compareIgnoreCase(arg, dialog[0]) == 0)
|
if (util.compareIgnoreCase(arg, dialog[0]) == 0)
|
||||||
{
|
{
|
||||||
@@ -387,7 +387,7 @@ const liberator = (function () //{{{
|
|||||||
if (!items.some(function (i) i.fullMenuPath == arg))
|
if (!items.some(function (i) i.fullMenuPath == arg))
|
||||||
return void liberator.echoerr("E334: Menu not found: " + arg);
|
return void liberator.echoerr("E334: Menu not found: " + arg);
|
||||||
|
|
||||||
for (let [,item] in Iterator(items))
|
for (let [, item] in Iterator(items))
|
||||||
{
|
{
|
||||||
if (item.fullMenuPath == arg)
|
if (item.fullMenuPath == arg)
|
||||||
item.doCommand();
|
item.doCommand();
|
||||||
@@ -539,7 +539,7 @@ const liberator = (function () //{{{
|
|||||||
/* XXX: Inline style. */
|
/* XXX: Inline style. */
|
||||||
e.enabled ? <span style="color: blue;">enabled</span>
|
e.enabled ? <span style="color: blue;">enabled</span>
|
||||||
: <span style="color: red;">disabled</span>,
|
: <span style="color: red;">disabled</span>,
|
||||||
e.description] for ([,e] in Iterator(extensions)))
|
e.description] for ([, e] in Iterator(extensions)))
|
||||||
);
|
);
|
||||||
|
|
||||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
@@ -1004,7 +1004,7 @@ const liberator = (function () //{{{
|
|||||||
triggerObserver: function (type)
|
triggerObserver: function (type)
|
||||||
{
|
{
|
||||||
let args = Array.slice(arguments, 1);
|
let args = Array.slice(arguments, 1);
|
||||||
for (let [,func] in Iterator(observers[type] || []))
|
for (let [, func] in Iterator(observers[type] || []))
|
||||||
func.apply(null, args);
|
func.apply(null, args);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1480,7 +1480,7 @@ const liberator = (function () //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
liberator.echomsg('Searching for "plugin/**/*.{js,vimp}" in "'
|
liberator.echomsg('Searching for "plugin/**/*.{js,vimp}" in "'
|
||||||
+ [dir.path.replace(/.plugin$/, "") for ([,dir] in Iterator(dirs))].join(",") + '"', 2);
|
+ [dir.path.replace(/.plugin$/, "") for ([, dir] in Iterator(dirs))].join(",") + '"', 2);
|
||||||
|
|
||||||
dirs.forEach(function (dir) {
|
dirs.forEach(function (dir) {
|
||||||
liberator.echomsg("Searching for \"" + (dir.path + "/**/*.{js,vimp}") + "\"", 3);
|
liberator.echomsg("Searching for \"" + (dir.path + "/**/*.{js,vimp}") + "\"", 3);
|
||||||
@@ -1609,7 +1609,7 @@ const liberator = (function () //{{{
|
|||||||
else if (!where)
|
else if (!where)
|
||||||
where = liberator.CURRENT_TAB;
|
where = liberator.CURRENT_TAB;
|
||||||
|
|
||||||
for (let [,url] in Iterator(urls))
|
for (let [, url] in Iterator(urls))
|
||||||
{
|
{
|
||||||
open(url, where);
|
open(url, where);
|
||||||
where = liberator.NEW_BACKGROUND_TAB;
|
where = liberator.NEW_BACKGROUND_TAB;
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ function Mappings() //{{{
|
|||||||
{
|
{
|
||||||
let maps = stack[mode] || [];
|
let maps = stack[mode] || [];
|
||||||
|
|
||||||
for (let [,map] in Iterator(maps))
|
for (let [, map] in Iterator(maps))
|
||||||
{
|
{
|
||||||
if (map.hasName(cmd))
|
if (map.hasName(cmd))
|
||||||
return map;
|
return map;
|
||||||
@@ -297,7 +297,7 @@ function Mappings() //{{{
|
|||||||
args = args[0];
|
args = args[0];
|
||||||
|
|
||||||
let found = false;
|
let found = false;
|
||||||
for (let [,mode] in Iterator(modes))
|
for (let [, mode] in Iterator(modes))
|
||||||
{
|
{
|
||||||
if (mappings.hasMap(mode, args))
|
if (mappings.hasMap(mode, args))
|
||||||
{
|
{
|
||||||
@@ -413,9 +413,9 @@ function Mappings() //{{{
|
|||||||
let map = new Map(modes, keys, description || "User defined mapping", action, extra);
|
let map = new Map(modes, keys, description || "User defined mapping", action, extra);
|
||||||
|
|
||||||
// remove all old mappings to this key sequence
|
// remove all old mappings to this key sequence
|
||||||
for (let [,name] in Iterator(map.names))
|
for (let [, name] in Iterator(map.names))
|
||||||
{
|
{
|
||||||
for (let [,mode] in Iterator(map.modes))
|
for (let [, mode] in Iterator(map.modes))
|
||||||
removeMap(mode, name);
|
removeMap(mode, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,9 +461,9 @@ function Mappings() //{{{
|
|||||||
let mappings = user[mode].concat(main[mode]);
|
let mappings = user[mode].concat(main[mode]);
|
||||||
let matches = [];
|
let matches = [];
|
||||||
|
|
||||||
for (let [,map] in Iterator(mappings))
|
for (let [, map] in Iterator(mappings))
|
||||||
{
|
{
|
||||||
for (let [,name] in Iterator(map.names))
|
for (let [, name] in Iterator(map.names))
|
||||||
{
|
{
|
||||||
if (name.indexOf(prefix) == 0 && name.length > prefix.length)
|
if (name.indexOf(prefix) == 0 && name.length > prefix.length)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ function Option(names, description, type, defaultValue, extraInfo) //{{{
|
|||||||
if (this.type == "boolean")
|
if (this.type == "boolean")
|
||||||
{
|
{
|
||||||
this.names = []; // reset since order is important
|
this.names = []; // reset since order is important
|
||||||
for (let [,name] in Iterator(names))
|
for (let [, name] in Iterator(names))
|
||||||
{
|
{
|
||||||
this.names.push(name);
|
this.names.push(name);
|
||||||
this.names.push("no" + name);
|
this.names.push("no" + name);
|
||||||
@@ -556,7 +556,7 @@ function Options() //{{{
|
|||||||
if (!args.length)
|
if (!args.length)
|
||||||
args[0] = "";
|
args[0] = "";
|
||||||
|
|
||||||
for (let [,arg] in args)
|
for (let [, arg] in args)
|
||||||
{
|
{
|
||||||
if (bang)
|
if (bang)
|
||||||
{
|
{
|
||||||
@@ -908,7 +908,7 @@ function Options() //{{{
|
|||||||
"Delete a variable",
|
"Delete a variable",
|
||||||
function (args)
|
function (args)
|
||||||
{
|
{
|
||||||
for (let [,name] in args)
|
for (let [, name] in args)
|
||||||
{
|
{
|
||||||
let reference = liberator.variableReference(name);
|
let reference = liberator.variableReference(name);
|
||||||
if (!reference[0])
|
if (!reference[0])
|
||||||
@@ -1192,7 +1192,7 @@ function Options() //{{{
|
|||||||
let prefArray = services.get("pref").getChildList("", { value: 0 });
|
let prefArray = services.get("pref").getChildList("", { value: 0 });
|
||||||
prefArray.sort();
|
prefArray.sort();
|
||||||
let prefs = function () {
|
let prefs = function () {
|
||||||
for (let [,pref] in Iterator(prefArray))
|
for (let [, pref] in Iterator(prefArray))
|
||||||
{
|
{
|
||||||
let userValue = services.get("pref").prefHasUserValue(pref);
|
let userValue = services.get("pref").prefHasUserValue(pref);
|
||||||
if (onlyNonDefault && !userValue || pref.indexOf(filter) == -1)
|
if (onlyNonDefault && !userValue || pref.indexOf(filter) == -1)
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ function Styles(name, store)
|
|||||||
if (matches.length == 0)
|
if (matches.length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (let [,sheet] in Iterator(matches.reverse()))
|
for (let [, sheet] in Iterator(matches.reverse()))
|
||||||
{
|
{
|
||||||
if (name)
|
if (name)
|
||||||
{
|
{
|
||||||
@@ -509,7 +509,7 @@ let (array = util.Array)
|
|||||||
catch (e) {}
|
catch (e) {}
|
||||||
context.fork("others", 0, this, function (context) {
|
context.fork("others", 0, this, function (context) {
|
||||||
context.title = ["Site"];
|
context.title = ["Site"];
|
||||||
context.completions = [[s, ""] for ([,s] in Iterator(styles.sites))];
|
context.completions = [[s, ""] for ([, s] in Iterator(styles.sites))];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -729,7 +729,7 @@ liberator.registerObserver("load_completion", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
context.title = ["Color Scheme", "Runtime Path"];
|
context.title = ["Color Scheme", "Runtime Path"];
|
||||||
context.completions = [[c.leafName.replace(/\.vimp$/, ""), c.parent.path] for ([,c] in Iterator(colors))]
|
context.completions = [[c.leafName.replace(/\.vimp$/, ""), c.parent.path] for ([, c] in Iterator(colors))]
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME: extract from :highlight
|
// FIXME: extract from :highlight
|
||||||
|
|||||||
@@ -1014,7 +1014,7 @@ function Tabs() //{{{
|
|||||||
*/
|
*/
|
||||||
stopAll: function ()
|
stopAll: function ()
|
||||||
{
|
{
|
||||||
for (let [,browser] in this.browsers)
|
for (let [, browser] in this.browsers)
|
||||||
browser.stop();
|
browser.stop();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ function CommandLine() //{{{
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.waiting = true;
|
this.waiting = true;
|
||||||
for (let [,context] in Iterator(list))
|
for (let [, context] in Iterator(list))
|
||||||
{
|
{
|
||||||
function done() !(idx >= n + context.items.length || idx == -2 && !context.items.length);
|
function done() !(idx >= n + context.items.length || idx == -2 && !context.items.length);
|
||||||
while (context.incomplete && !done())
|
while (context.incomplete && !done())
|
||||||
|
|||||||
@@ -817,13 +817,13 @@ util.Array.uniq = function uniq(ary, unsorted)
|
|||||||
let ret = [];
|
let ret = [];
|
||||||
if (unsorted)
|
if (unsorted)
|
||||||
{
|
{
|
||||||
for (let [,item] in Iterator(ary))
|
for (let [, item] in Iterator(ary))
|
||||||
if (ret.indexOf(item) == -1)
|
if (ret.indexOf(item) == -1)
|
||||||
ret.push(item);
|
ret.push(item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (let [,item] in Iterator(ary.sort()))
|
for (let [, item] in Iterator(ary.sort()))
|
||||||
{
|
{
|
||||||
if (item != last || !ret.length)
|
if (item != last || !ret.length)
|
||||||
ret.push(item);
|
ret.push(item);
|
||||||
@@ -889,7 +889,7 @@ Struct.prototype = {
|
|||||||
|
|
||||||
// Add no-sideeffect array methods. Can't set new Array() as the prototype or
|
// Add no-sideeffect array methods. Can't set new Array() as the prototype or
|
||||||
// get length() won't work.
|
// get length() won't work.
|
||||||
for (let [,k] in Iterator(["concat", "every", "filter", "forEach", "indexOf", "join", "lastIndexOf",
|
for (let [, k] in Iterator(["concat", "every", "filter", "forEach", "indexOf", "join", "lastIndexOf",
|
||||||
"map", "reduce", "reduceRight", "reverse", "slice", "some", "sort"]))
|
"map", "reduce", "reduceRight", "reverse", "slice", "some", "sort"]))
|
||||||
Struct.prototype[k] = Array.prototype[k];
|
Struct.prototype[k] = Array.prototype[k];
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ function Addressbook() //{{{
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
let list = template.tabular(["Name", "Address"], [],
|
let list = template.tabular(["Name", "Address"], [],
|
||||||
[[util.clip(a[0], 50), address[1]] for ([,address] in Iterator(addresses))]
|
[[util.clip(a[0], 50), address[1]] for ([, address] in Iterator(addresses))]
|
||||||
);
|
);
|
||||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ function Mail() //{{{
|
|||||||
services.get("smtpService").defaultServer = server;
|
services.get("smtpService").defaultServer = server;
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
completer: function (context) [[s.key, s.serverURI] for ([,s] in Iterator(mail.smtpServers))],
|
completer: function (context) [[s.key, s.serverURI] for ([, s] in Iterator(mail.smtpServers))],
|
||||||
validator: Option.validateCompleter
|
validator: Option.validateCompleter
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ const config = { //{{{
|
|||||||
|
|
||||||
let menu = document.getElementById("viewSidebarMenu");
|
let menu = document.getElementById("viewSidebarMenu");
|
||||||
|
|
||||||
for (let [,panel] in Iterator(menu.childNodes))
|
for (let [, panel] in Iterator(menu.childNodes))
|
||||||
{
|
{
|
||||||
if (compare(panel.label, arg))
|
if (compare(panel.label, arg))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ commands.addUserCommand(["regr[essions]"],
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
let testDescription = util.clip(test.cmds.join(" -> "), 80);
|
let testDescription = util.clip(test.cmds.join(" -> "), 80);
|
||||||
for (let [,cmd] in Iterator(test.cmds))
|
for (let [, cmd] in Iterator(test.cmds))
|
||||||
{
|
{
|
||||||
if (skipTests.indexOf(cmd) != -1)
|
if (skipTests.indexOf(cmd) != -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ function Player() // {{{
|
|||||||
{
|
{
|
||||||
let pages = player.getMediaPages();
|
let pages = player.getMediaPages();
|
||||||
|
|
||||||
for ([,page] in Iterator(pages))
|
for ([, page] in Iterator(pages))
|
||||||
{
|
{
|
||||||
if (util.compareIgnoreCase(arg, page.contentTitle) == 0)
|
if (util.compareIgnoreCase(arg, page.contentTitle) == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user