,
this.document);
data.document = this.document;
try {
@@ -139,7 +139,7 @@ var MOW = Module("mow", {
}
else {
let style = isString(data) ? "pre-wrap" : "nowrap";
- this.lastOutput =
{data}
;
+ this.lastOutput =
{data}
;
var output = DOM(this.lastOutput, this.document);
}
diff --git a/common/modules/base.jsm b/common/modules/base.jsm
index 5b337207..77b35d81 100644
--- a/common/modules/base.jsm
+++ b/common/modules/base.jsm
@@ -868,6 +868,7 @@ Class.Memoize = function Memoize(getter, wait)
let done = false;
if (wait)
+ // Crazy, yeah, I know. -- Kris
this.get = function replace() {
let obj = this.instance || this;
Object.defineProperty(obj, key, {
@@ -892,7 +893,7 @@ Class.Memoize = function Memoize(getter, wait)
return this[key];
};
else
- this.get = function replace() {
+ this.get = function g_Memoize() {
let obj = this.instance || this;
try {
Class.replaceProperty(obj, key, null);
@@ -903,7 +904,7 @@ Class.Memoize = function Memoize(getter, wait)
}
};
- this.set = function replace(val) Class.replaceProperty(this.instance || this, val);
+ this.set = function s_Memoize(val) Class.replaceProperty(this.instance || this, key, val);
}
});
@@ -1227,6 +1228,8 @@ var StructBase = Class("StructBase", Array, {
this[i] = arguments[i];
},
+ get toStringParams() this,
+
clone: function struct_clone() this.constructor.apply(null, this.slice()),
closure: Class.Property(Object.getOwnPropertyDescriptor(Class.prototype, "closure")),
diff --git a/common/modules/buffer.jsm b/common/modules/buffer.jsm
index cdd13da0..2ad6b15d 100644
--- a/common/modules/buffer.jsm
+++ b/common/modules/buffer.jsm
@@ -289,7 +289,7 @@ var Buffer = Module("Buffer", {
* @param {Node} elem The element to focus.
*/
focusElement: function focusElement(elem) {
- let { dactyl } = this.modules;
+ let { Editor, dactyl } = this.modules;
let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem;
overlay.setData(elem, "focus-allowed", true);
diff --git a/common/modules/completion.jsm b/common/modules/completion.jsm
index b5178014..a147544d 100644
--- a/common/modules/completion.jsm
+++ b/common/modules/completion.jsm
@@ -633,25 +633,33 @@ var CompletionContext = Class("CompletionContext", {
return iter.map(util.range(start, end, step), function (i) items[i]);
},
+ getRow: function getRow(idx) this.cache.rows && this.cache.rows[idx],
+
getRows: function getRows(start, end, doc) {
let self = this;
let items = this.items;
let cache = this.cache.rows;
let step = start > end ? -1 : 1;
+
start = Math.max(0, start || 0);
end = Math.min(items.length, end != null ? end : items.length);
- for (let i in util.range(start, end, step))
- try {
- yield [i, cache[i] = cache[i] || util.xmlToDom(self.createRow(items[i]), doc)];
- }
- catch (e) {
- util.reportError(e);
- yield [i, cache[i] = cache[i] || util.xmlToDom(
-
-
{items[i].text}
- {e}
- , doc)];
- }
+
+ for (let i in util.range(start, end, step)) {
+ if (!cache[i])
+ try {
+ cache[i] = util.xmlToDom(self.createRow(items[i]), doc);
+ }
+ catch (e) {
+ util.reportError(e);
+ cache[i] = util.xmlToDom(
+
+
{items[i].text}
+ {e}
+ , doc);
+ }
+
+ yield [i, cache[i]];
+ }
},
/**
diff --git a/common/modules/contexts.jsm b/common/modules/contexts.jsm
index f5744d50..0cf60472 100644
--- a/common/modules/contexts.jsm
+++ b/common/modules/contexts.jsm
@@ -94,7 +94,7 @@ var Contexts = Module("contexts", {
cleanup: function () {
for each (let module in this.pluginModules)
- util.trapErrors("cleanup", module);
+ util.trapErrors("unload", module);
this.pluginModules = {};
},
diff --git a/common/modules/dom.jsm b/common/modules/dom.jsm
index c21fddb5..3ef85156 100644
--- a/common/modules/dom.jsm
+++ b/common/modules/dom.jsm
@@ -36,10 +36,13 @@ function BooleanAttribute(attr) ({
* change in the near future.
*/
var DOM = Class("DOM", {
- init: function init(val, context) {
+ init: function init(val, context, nodes) {
let self;
let length = 0;
+ if (nodes)
+ this.nodes = nodes;
+
if (context instanceof Ci.nsIDOMDocument)
this.document = context;
@@ -48,7 +51,7 @@ var DOM = Class("DOM", {
if (val == null)
;
- else if (typeof val == "xml")
+ else if (typeof val == "xml" && context instanceof Ci.nsIDOMDocument)
this[length++] = DOM.fromXML(val, context, this.nodes);
else if (val instanceof Ci.nsIDOMNode || val instanceof Ci.nsIDOMWindow)
this[length++] = val;
@@ -58,6 +61,8 @@ var DOM = Class("DOM", {
else if ("__iterator__" in val || isinstance(val, ["Iterator", "Generator"]))
for (let elem in val)
this[length++] = elem;
+ else
+ this[length++] = val;
this.length = length;
return self || this;
@@ -130,19 +135,22 @@ var DOM = Class("DOM", {
}, self || this);
let dom = this;
- function munge(val) {
+ function munge(val, container, idx) {
if (val instanceof Ci.nsIDOMRange)
return val.extractContents();
if (val instanceof Ci.nsIDOMNode)
return val;
- if (typeof val == "xml")
+ if (typeof val == "xml") {
val = dom.constructor(val, dom.document);
+ if (container)
+ container[idx] = val[0];
+ }
if (isObject(val) && "length" in val) {
let frag = dom.document.createDocumentFragment();
for (let i = 0; i < val.length; i++)
- frag.appendChild(munge(val[i]));
+ frag.appendChild(munge(val[i], val, i));
return frag;
}
return val;
diff --git a/common/modules/util.jsm b/common/modules/util.jsm
index fb7f1878..ae40dd21 100644
--- a/common/modules/util.jsm
+++ b/common/modules/util.jsm
@@ -28,7 +28,7 @@ var FailedAssertion = Class("FailedAssertion", ErrorBase, {
noTrace: true
});
-var Point = Struct("x", "y");
+var Point = Struct("Point", "x", "y");
var wrapCallback = function wrapCallback(fn, isEvent) {
if (!fn.wrapper)
diff --git a/common/skin/dactyl.css b/common/skin/dactyl.css
index f4db095c..f8726865 100644
--- a/common/skin/dactyl.css
+++ b/common/skin/dactyl.css
@@ -68,6 +68,10 @@ input[type=file][dactyl|highlight~=HintElem] {
line-height: 1.5em !important;
}
+.completion-items-container {
+ overflow: hidden;
+}
+
.td-span {
display: inline-block;
overflow: visible;
@@ -191,11 +195,9 @@ statusbarpanel {
/* MOW */
-.dactyl-completions,
-#dactyl-multiline-output,
-#dactyl-multiline-input {
- background-color: white;
- color: black;
+#dactyl-commandline-prompt *,
+#dactyl-commandline-command {
+ font: inherit;
}
.dactyl-completions-content,
@@ -206,11 +208,6 @@ statusbarpanel {
margin: 0px;
}
-#dactyl-commandline-prompt *,
-#dactyl-commandline-command {
- font: inherit;
-}
-
.dactyl-completions-content table,
#dactyl-multiline-output-content table {
white-space: inherit;
diff --git a/common/skin/global-styles.css b/common/skin/global-styles.css
index adcf325c..5f175649 100644
--- a/common/skin/global-styles.css
+++ b/common/skin/global-styles.css
@@ -84,6 +84,9 @@ CmdInput;.dactyl-commandline-command
CmdOutput /* The output of commands executed by
:run */ \
white-space: pre;
+Comp;;;FontFixed,Normal /* The completion window */ \
+ margin: 0; border-top: 1px solid black;
+
CompGroup /* Item group in completion output */
CompGroup:not(:first-of-type) margin-top: .5em;
CompGroup:last-of-type padding-bottom: 1.5ex;