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

whitespace/formatting fixes

This commit is contained in:
Doug Kearns
2008-11-28 13:01:20 +00:00
parent d25867e7b5
commit 5a3a35ea26
10 changed files with 30 additions and 26 deletions

View File

@@ -222,7 +222,7 @@ function Bookmarks() //{{{
{
// Forces a load, if not already loaded but wait 10sec
// so most tabs should be restored and the CPU should be idle again usually
setTimeout(function() { liberator.callFunctionInThread(null, function () cache.load()); }, 10000);
setTimeout(function () { liberator.callFunctionInThread(null, function () cache.load()); }, 10000);
}
});

View File

@@ -850,7 +850,7 @@ function Commands() //{{{
// Yeah, this is a bit scary. Perhaps I'll fix it when I'm
// awake.
options: util.Array.assocToObj(
util.map({argCount: "-nargs", bang: "-bang", count: "-count"},
util.map({ argCount: "-nargs", bang: "-bang", count: "-count" },
function ([k, v]) k in cmd && cmd[k] != "0" && [v, typeof cmd[k] == "boolean" ? null : cmd[k]])
.filter(util.identity)),
arguments: [cmd.name],

View File

@@ -270,7 +270,7 @@ CompletionContext.prototype = {
let self = this;
delete this._substrings;
let filtered = this.filterFunc(items.map(function (item) ({ text: self.getKey({item: item}, "text"), item: item })));
let filtered = this.filterFunc(items.map(function (item) ({ text: self.getKey({ item: item }, "text"), item: item })));
let quote = this.quote;
if (quote)
@@ -846,7 +846,7 @@ function Completion() //{{{
context.process = [null, function highlight(item, v) template.highlight(v, true)];
if (!context.anchored)
context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, key.length), key));
context.compare = function ({item: {key: a}}, {item: {key: b}})
context.compare = function ({ item: { key: a } }, { item: { key: b } })
{
if (!isNaN(a) && !isNaN(b))
return a - b;
@@ -857,10 +857,12 @@ function Completion() //{{{
let filter = key + (string || "");
for (let [,obj] in Iterator(objects))
{
try {
this.context.fork(obj[1], top[OFFSET], this, fill,
obj[0], obj[1], compl, compl != orig, filter, last, key.length);
} catch(e) { liberator.reportError(e) }
try
{
this.context.fork(obj[1], top[OFFSET], this, fill,
obj[0], obj[1], compl, compl != orig, filter, last, key.length);
}
catch (e) { liberator.reportError(e) }
}
if (orig)
return;
@@ -1031,7 +1033,7 @@ function Completion() //{{{
},
// discard all entries in the 'urls' array, which don't match 'filter
// urls must be of type [{url: "..", title: "..", tags: [...], keyword: ".."}, ...]
// urls must be of type [{ url: "..", title: "..", tags: [...], keyword: ".." }, ...]
filterURLArray: function filterURLArray(urls, filter, filterTags)
{
var filtered = [];
@@ -1141,7 +1143,7 @@ function Completion() //{{{
context.completions = bookmarks.get(context.filter)
context.filters = [];
if (tags)
context.filters.push(function ({item: item}) tags.every(function (tag) item.tags.indexOf(tag) > -1));
context.filters.push(function ({ item: item }) tags.every(function (tag) item.tags.indexOf(tag) > -1));
},
buffer: function buffer(context)
@@ -1379,7 +1381,7 @@ function Completion() //{{{
context.keys = { text: "names", description: "description" };
context.completions = options;
if (scope)
context.filters.push(function ({item: opt}) opt.scope & scope);
context.filters.push(function ({ item: opt }) opt.scope & scope);
},
optionValue: function (context, name, op, curValue)
@@ -1494,7 +1496,7 @@ function Completion() //{{{
let engine = ss.getEngineByAlias(name);
if (!engine)
return;
let [, word] = /^\s*(\S+)/.exec(context.filter) || [];
let [,word] = /^\s*(\S+)/.exec(context.filter) || [];
if (!kludge && word == name) // FIXME: Check for matching keywords
return;
let ctxt = context.fork(name, 0);

View File

@@ -195,7 +195,7 @@ function Mappings() //{{{
return [
{
command: this.name,
options: map.silent ? {"<silent>": null} : {},
options: map.silent ? { "<silent>": null } : {},
arguments: [map.names[0]],
literalArg: map.rhs
}

View File

@@ -689,7 +689,7 @@ function Options() //{{{
if (context.filter.indexOf("=") == -1)
{
if (prefix)
context.filters.push(function ({item: opt}) opt.type == "boolean" || prefix == "inv" && opt.values instanceof Array);
context.filters.push(function ({ item: opt }) opt.type == "boolean" || prefix == "inv" && opt.values instanceof Array);
return completion.option(context, opt.scope);
}
else if (prefix == "no")

View File

@@ -395,9 +395,11 @@ let (array = util.Array)
}
const styles = storage.newObject("styles", Styles, false);
try {
const highlight = storage.newObject("highlight", Highlights, false);
} catch(e) { liberator.reportError(e) }
try
{
const highlight = storage.newObject("highlight", Highlights, false);
}
catch (e) { liberator.reportError(e) }
liberator.registerObserver("load_commands", function ()
{
@@ -481,7 +483,7 @@ liberator.registerObserver("load_commands", function ()
{
command: this.name,
bang: true,
options: sty.name ? {"-name": sty.name} : {},
options: sty.name ? { "-name": sty.name } : {},
arguments: [sty.sites.join(",")],
literalArg: sty.css
} for ([k, sty] in styles.userSheets)

View File

@@ -33,7 +33,7 @@ default xml namespace = XHTML;
const util = { //{{{
Array: {
// [["a", "b"], ["c", "d"]] -> {a: "b", c: "d"}
// [["a", "b"], ["c", "d"]] -> { a: "b", c: "d" }
// From Common Lisp, more or less
assocToObj: function assocToObj(assoc)
{
@@ -64,7 +64,7 @@ const util = { //{{{
let ret = [];
if (unsorted)
{
for (let [, item] in Iterator(ary))
for (let [,item] in Iterator(ary))
if (ret.indexOf(item) == -1)
ret.push(item);
}
@@ -352,7 +352,7 @@ const util = { //{{{
catch (e) {}
if (!hasValue)
{
if(i instanceof Array && i.length == 2)
if (i instanceof Array && i.length == 2)
[i, value] = i;
else
var noVal = true;