mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 08:17:59 +01:00
Fix Options#op
This commit is contained in:
@@ -57,12 +57,12 @@ function CompletionContext(editor, name, offset)
|
|||||||
self.keys = util.cloneObject(parent.keys);
|
self.keys = util.cloneObject(parent.keys);
|
||||||
["compare", "editor", "filterFunc", "keys", "process", "quote", "title", "top"].forEach(function (key)
|
["compare", "editor", "filterFunc", "keys", "process", "quote", "title", "top"].forEach(function (key)
|
||||||
self[key] = parent[key]);
|
self[key] = parent[key]);
|
||||||
|
if (self != this)
|
||||||
|
return self;
|
||||||
["contextList", "onUpdate", "selectionTypes", "tabPressed", "updateAsync", "value"].forEach(function (key) {
|
["contextList", "onUpdate", "selectionTypes", "tabPressed", "updateAsync", "value"].forEach(function (key) {
|
||||||
self.__defineGetter__(key, function () this.top[key]);
|
self.__defineGetter__(key, function () this.top[key]);
|
||||||
self.__defineSetter__(key, function (val) this.top[key] = val);
|
self.__defineSetter__(key, function (val) this.top[key] = val);
|
||||||
});
|
});
|
||||||
if (self != this)
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -95,12 +95,8 @@ function CompletionContext(editor, name, offset)
|
|||||||
this.keys = { text: 0, description: 1, icon: "icon" };
|
this.keys = { text: 0, description: 1, icon: "icon" };
|
||||||
this.offset = offset || 0;
|
this.offset = offset || 0;
|
||||||
this.onUpdate = function () true;
|
this.onUpdate = function () true;
|
||||||
this.process = [];
|
|
||||||
this.tabPressed = false;
|
|
||||||
this.title = ["Completions"];
|
|
||||||
this.top = this;
|
this.top = this;
|
||||||
this.__defineGetter__("incomplete", function () this.contextList.some(function (c) c.parent && c.incomplete));
|
this.__defineGetter__("incomplete", function () this.contextList.some(function (c) c.parent && c.incomplete));
|
||||||
this.selectionTypes = {};
|
|
||||||
this.reset();
|
this.reset();
|
||||||
}
|
}
|
||||||
this.name = name || "";
|
this.name = name || "";
|
||||||
@@ -390,8 +386,10 @@ CompletionContext.prototype = {
|
|||||||
this.highlight(0, 0, type);
|
this.highlight(0, 0, type);
|
||||||
this.contextList = [];
|
this.contextList = [];
|
||||||
this.offset = 0;
|
this.offset = 0;
|
||||||
|
this.process = [];
|
||||||
this.selectionTypes = {};
|
this.selectionTypes = {};
|
||||||
this.tabPressed = false;
|
this.tabPressed = false;
|
||||||
|
this.title = ["Completions"];
|
||||||
this.updateAsync = false;
|
this.updateAsync = false;
|
||||||
this.value = this.editor ? this.editor.rootElement.textContent : this._value;
|
this.value = this.editor ? this.editor.rootElement.textContent : this._value;
|
||||||
//for (let key in (k for ([k, v] in Iterator(self.contexts)) if (v.offset > this.caret)))
|
//for (let key in (k for ([k, v] in Iterator(self.contexts)) if (v.offset > this.caret)))
|
||||||
|
|||||||
@@ -1095,17 +1095,21 @@ const liberator = (function () //{{{
|
|||||||
{
|
{
|
||||||
if (Components.utils.reportError)
|
if (Components.utils.reportError)
|
||||||
Components.utils.reportError(error);
|
Components.utils.reportError(error);
|
||||||
let obj = {
|
try
|
||||||
toString: function () error.toString(),
|
|
||||||
stack: <>{error.stack.replace(/^/mg, "\t")}</>
|
|
||||||
};
|
|
||||||
for (let [k, v] in Iterator(error))
|
|
||||||
{
|
{
|
||||||
if (!(k in obj))
|
let obj = {
|
||||||
obj[k] = v;
|
toString: function () error.toString(),
|
||||||
|
stack: <>{error.stack.replace(/^/mg, "\t")}</>
|
||||||
|
};
|
||||||
|
for (let [k, v] in Iterator(error))
|
||||||
|
{
|
||||||
|
if (!(k in obj))
|
||||||
|
obj[k] = v;
|
||||||
|
}
|
||||||
|
liberator.dump(obj);
|
||||||
|
liberator.dump("");
|
||||||
}
|
}
|
||||||
liberator.dump(obj);
|
catch (e) {}
|
||||||
liberator.dump("");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
restart: function ()
|
restart: function ()
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ Option.prototype = {
|
|||||||
op: function (operator, values, scope, invert)
|
op: function (operator, values, scope, invert)
|
||||||
{
|
{
|
||||||
let newValue = null;
|
let newValue = null;
|
||||||
|
let self = this;
|
||||||
|
|
||||||
switch (this.type)
|
switch (this.type)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user