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

Fix brokenness.

This commit is contained in:
Kris Maglione
2015-02-25 12:10:35 -08:00
parent a8b1b278e2
commit e819e7616d
4 changed files with 11 additions and 5 deletions

View File

@@ -1724,7 +1724,7 @@ update(iter, {
const Iter = Class("Iter", {
init: function init(iter) {
this.iter = iter;
if ("__iterator__" in iter)
if (!(Symbol.iterator in iter) && "__iterator__" in iter)
this.iter = iter.__iterator__();
if (this.iter.finalize)

View File

@@ -492,8 +492,11 @@ var CompletionContext = Class("CompletionContext", {
// Item formatters
this.processor = Array.slice(this.process);
if (!this.anchored)
this.processor[0] = function processor_0(item, text) self.process[0].call(self, item,
this.processor[0] = function processor_0(item, text) {
return self.process[0].call(
self, item,
template.highlightFilter(item.text, self.filter, null, item.isURI));
};
try {
// Item prototypes
@@ -659,7 +662,10 @@ var CompletionContext = Class("CompletionContext", {
}
catch (e) {
util.reportError(e);
util.dump(util.prettifyJSON(this.createRow(this.items[idx]), null, true));
try {
util.dump(util.prettifyJSON(this.createRow(this.items[idx]), null, true));
}
catch (e) {}
cache[idx] = DOM.fromJSON(
["div", { highlight: "CompItem", style: "white-space: nowrap" },
["li", { highlight: "CompResult" }, this.text + "\u00a0"],

View File

@@ -754,7 +754,7 @@ var Option = Class("Option", {
acceptable = completions.call(this);
if (isArray(acceptable))
acceptable = new RealSet(acceptable.map(([k]) => k));
acceptable = new RealSet(acceptable.map((v) => v[0]));
else
acceptable = new RealSet(this.parseKey(k)
for (k of Object.keys(acceptable)));

View File

@@ -612,7 +612,7 @@ var Styles = Module("Styles", {
let sheet = args["-group"].get(args["-name"]);
if (args.completeArg == 0) {
if (sheet)
context.completions = [[sheet.sites.join(","), "Current Value"]];
context.completions = [[sheet.sites.join(","), _("option.currentValue")]];
context.fork("sites", 0, Styles, "completeSite", window.content, args["-group"]);
}
else if (args.completeArg == 1) {