mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 08:08:00 +01:00
whitespace/formatting fixes
This commit is contained in:
@@ -222,7 +222,7 @@ function Bookmarks() //{{{
|
|||||||
{
|
{
|
||||||
// Forces a load, if not already loaded but wait 10sec
|
// Forces a load, if not already loaded but wait 10sec
|
||||||
// so most tabs should be restored and the CPU should be idle again usually
|
// 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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -850,7 +850,7 @@ function Commands() //{{{
|
|||||||
// Yeah, this is a bit scary. Perhaps I'll fix it when I'm
|
// Yeah, this is a bit scary. Perhaps I'll fix it when I'm
|
||||||
// awake.
|
// awake.
|
||||||
options: util.Array.assocToObj(
|
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]])
|
function ([k, v]) k in cmd && cmd[k] != "0" && [v, typeof cmd[k] == "boolean" ? null : cmd[k]])
|
||||||
.filter(util.identity)),
|
.filter(util.identity)),
|
||||||
arguments: [cmd.name],
|
arguments: [cmd.name],
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ CompletionContext.prototype = {
|
|||||||
let self = this;
|
let self = this;
|
||||||
delete this._substrings;
|
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;
|
let quote = this.quote;
|
||||||
if (quote)
|
if (quote)
|
||||||
@@ -846,7 +846,7 @@ function Completion() //{{{
|
|||||||
context.process = [null, function highlight(item, v) template.highlight(v, true)];
|
context.process = [null, function highlight(item, v) template.highlight(v, true)];
|
||||||
if (!context.anchored)
|
if (!context.anchored)
|
||||||
context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, key.length), key));
|
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))
|
if (!isNaN(a) && !isNaN(b))
|
||||||
return a - b;
|
return a - b;
|
||||||
@@ -857,10 +857,12 @@ function Completion() //{{{
|
|||||||
let filter = key + (string || "");
|
let filter = key + (string || "");
|
||||||
for (let [,obj] in Iterator(objects))
|
for (let [,obj] in Iterator(objects))
|
||||||
{
|
{
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
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);
|
||||||
} catch(e) { liberator.reportError(e) }
|
}
|
||||||
|
catch (e) { liberator.reportError(e) }
|
||||||
}
|
}
|
||||||
if (orig)
|
if (orig)
|
||||||
return;
|
return;
|
||||||
@@ -1031,7 +1033,7 @@ function Completion() //{{{
|
|||||||
},
|
},
|
||||||
|
|
||||||
// discard all entries in the 'urls' array, which don't match 'filter
|
// 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)
|
filterURLArray: function filterURLArray(urls, filter, filterTags)
|
||||||
{
|
{
|
||||||
var filtered = [];
|
var filtered = [];
|
||||||
@@ -1141,7 +1143,7 @@ function Completion() //{{{
|
|||||||
context.completions = bookmarks.get(context.filter)
|
context.completions = bookmarks.get(context.filter)
|
||||||
context.filters = [];
|
context.filters = [];
|
||||||
if (tags)
|
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)
|
buffer: function buffer(context)
|
||||||
@@ -1379,7 +1381,7 @@ function Completion() //{{{
|
|||||||
context.keys = { text: "names", description: "description" };
|
context.keys = { text: "names", description: "description" };
|
||||||
context.completions = options;
|
context.completions = options;
|
||||||
if (scope)
|
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)
|
optionValue: function (context, name, op, curValue)
|
||||||
@@ -1494,7 +1496,7 @@ function Completion() //{{{
|
|||||||
let engine = ss.getEngineByAlias(name);
|
let engine = ss.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);
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ function Mappings() //{{{
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
command: this.name,
|
command: this.name,
|
||||||
options: map.silent ? {"<silent>": null} : {},
|
options: map.silent ? { "<silent>": null } : {},
|
||||||
arguments: [map.names[0]],
|
arguments: [map.names[0]],
|
||||||
literalArg: map.rhs
|
literalArg: map.rhs
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -689,7 +689,7 @@ function Options() //{{{
|
|||||||
if (context.filter.indexOf("=") == -1)
|
if (context.filter.indexOf("=") == -1)
|
||||||
{
|
{
|
||||||
if (prefix)
|
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);
|
return completion.option(context, opt.scope);
|
||||||
}
|
}
|
||||||
else if (prefix == "no")
|
else if (prefix == "no")
|
||||||
|
|||||||
@@ -395,9 +395,11 @@ let (array = util.Array)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const styles = storage.newObject("styles", Styles, false);
|
const styles = storage.newObject("styles", Styles, false);
|
||||||
try {
|
try
|
||||||
const highlight = storage.newObject("highlight", Highlights, false);
|
{
|
||||||
} catch(e) { liberator.reportError(e) }
|
const highlight = storage.newObject("highlight", Highlights, false);
|
||||||
|
}
|
||||||
|
catch (e) { liberator.reportError(e) }
|
||||||
|
|
||||||
liberator.registerObserver("load_commands", function ()
|
liberator.registerObserver("load_commands", function ()
|
||||||
{
|
{
|
||||||
@@ -481,7 +483,7 @@ liberator.registerObserver("load_commands", function ()
|
|||||||
{
|
{
|
||||||
command: this.name,
|
command: this.name,
|
||||||
bang: true,
|
bang: true,
|
||||||
options: sty.name ? {"-name": sty.name} : {},
|
options: sty.name ? { "-name": sty.name } : {},
|
||||||
arguments: [sty.sites.join(",")],
|
arguments: [sty.sites.join(",")],
|
||||||
literalArg: sty.css
|
literalArg: sty.css
|
||||||
} for ([k, sty] in styles.userSheets)
|
} for ([k, sty] in styles.userSheets)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ default xml namespace = XHTML;
|
|||||||
const util = { //{{{
|
const util = { //{{{
|
||||||
|
|
||||||
Array: {
|
Array: {
|
||||||
// [["a", "b"], ["c", "d"]] -> {a: "b", c: "d"}
|
// [["a", "b"], ["c", "d"]] -> { a: "b", c: "d" }
|
||||||
// From Common Lisp, more or less
|
// From Common Lisp, more or less
|
||||||
assocToObj: function assocToObj(assoc)
|
assocToObj: function assocToObj(assoc)
|
||||||
{
|
{
|
||||||
@@ -64,7 +64,7 @@ const util = { //{{{
|
|||||||
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);
|
||||||
}
|
}
|
||||||
@@ -352,7 +352,7 @@ const util = { //{{{
|
|||||||
catch (e) {}
|
catch (e) {}
|
||||||
if (!hasValue)
|
if (!hasValue)
|
||||||
{
|
{
|
||||||
if(i instanceof Array && i.length == 2)
|
if (i instanceof Array && i.length == 2)
|
||||||
[i, value] = i;
|
[i, value] = i;
|
||||||
else
|
else
|
||||||
var noVal = true;
|
var noVal = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user