mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-24 04:22:26 +01:00
Fix echo bugs. Closes issue #414.
This commit is contained in:
@@ -135,7 +135,7 @@ var CommandWidgets = Class("CommandWidgets", {
|
||||
return this.statusbar;
|
||||
|
||||
let statusElem = this.statusbar.message;
|
||||
if (value && statusElem.editor && statusElem.editor.rootElement.scrollWidth > statusElem.scrollWidth)
|
||||
if (value && !value[2] && statusElem.editor && statusElem.editor.rootElement.scrollWidth > statusElem.scrollWidth)
|
||||
return this.commandbar;
|
||||
return this.activeGroup.mode;
|
||||
}
|
||||
@@ -173,7 +173,8 @@ var CommandWidgets = Class("CommandWidgets", {
|
||||
let elem = self.getGroup(obj.name, obj.value)[obj.name];
|
||||
if (obj.value != null)
|
||||
return [obj.value[0],
|
||||
obj.get ? obj.get.call(this, elem) : elem.value];
|
||||
obj.get ? obj.get.call(this, elem) : elem.value]
|
||||
.concat(obj.value.slice(2))
|
||||
return null;
|
||||
},
|
||||
|
||||
@@ -670,7 +671,7 @@ var CommandLine = Module("commandline", {
|
||||
* messages move to the MOW.
|
||||
*/
|
||||
_echoLine: function echoLine(str, highlightGroup, forceSingle, silent) {
|
||||
this.widgets.message = str ? [highlightGroup, str] : null;
|
||||
this.widgets.message = str ? [highlightGroup, str, forceSingle] : null;
|
||||
|
||||
dactyl.triggerObserver("echoLine", str, highlightGroup, null, forceSingle);
|
||||
|
||||
@@ -718,7 +719,7 @@ var CommandLine = Module("commandline", {
|
||||
highlightGroup = highlightGroup || this.HL_NORMAL;
|
||||
|
||||
if (flags & this.APPEND_TO_MESSAGES) {
|
||||
let message = isObject(data) ? data : { message: data };
|
||||
let message = isObject(data) && !isinstance(data, _) ? data : { message: String(data) };
|
||||
this._messageHistory.add(update({ highlight: highlightGroup }, message));
|
||||
data = message.message;
|
||||
}
|
||||
@@ -1684,8 +1685,10 @@ var ItemList = Class("ItemList", {
|
||||
let items = nodes.items;
|
||||
let [start, end, waiting] = getRows(context);
|
||||
|
||||
if (context.message)
|
||||
if (context.message) {
|
||||
nodes.message.textContent = "";
|
||||
nodes.message.appendChild(this._dom(context.message));
|
||||
}
|
||||
nodes.message.style.display = context.message ? "block" : "none";
|
||||
nodes.waiting.style.display = waiting ? "block" : "none";
|
||||
nodes.up.style.opacity = "0";
|
||||
|
||||
@@ -119,15 +119,20 @@ var MOW = Module("mow", {
|
||||
// after interpolated data.
|
||||
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||
|
||||
if (isObject(data)) {
|
||||
if (isObject(data) && !isinstance(data, _)) {
|
||||
this.lastOutput = null;
|
||||
|
||||
var output = util.xmlToDom(<div class="ex-command-output" style="white-space: nowrap" highlight={highlightGroup}/>,
|
||||
this.document);
|
||||
data.document = this.document;
|
||||
output.appendChild(data.message);
|
||||
|
||||
this.messages.push(data);
|
||||
try {
|
||||
output.appendChild(data.message);
|
||||
}
|
||||
catch (e) {
|
||||
util.reportError(e);
|
||||
util.dump(data);
|
||||
this.messages.push(data);
|
||||
}
|
||||
}
|
||||
else {
|
||||
let style = isString(data) ? "pre" : "nowrap";
|
||||
|
||||
@@ -32,11 +32,12 @@ var StatusLine = Module("statusline", {
|
||||
-moz-appearance: none !important;
|
||||
<padding>
|
||||
}
|
||||
!AddonButton;#addon-bar>xul|toolbarbutton,#addon-bar>xul|toolbarbutton>xul|toolbarbutton {
|
||||
!AddonButton;#addon-bar xul|toolbarbutton {
|
||||
-moz-appearance: none !important;
|
||||
padding: 0 !important;
|
||||
border-width: 0px !important;
|
||||
min-width: 0 !important;
|
||||
color: inherit !important;
|
||||
}
|
||||
AddonButton:not(:hover) background: transparent !important;
|
||||
]]>)({ padding: util.OS.isMacOSX ? "padding-right: 10px !important;" : "" }));
|
||||
@@ -111,7 +112,7 @@ var StatusLine = Module("statusline", {
|
||||
break;
|
||||
case "command":
|
||||
if (link)
|
||||
dactyl.echo(_("status.link", link), commandline.DISALLOW_MULTILINE);
|
||||
dactyl.echo(_("status.link", link), commandline.FORCE_SINGLELINE);
|
||||
else
|
||||
commandline.clear();
|
||||
break;
|
||||
|
||||
@@ -627,7 +627,7 @@ var JavaScript = Module("javascript", {
|
||||
"CSSFontFaceStyleDecl", "CSSGroupRuleRuleList", "CSSNameSpaceRule",
|
||||
"CSSRGBColor", "CSSRect", "ComputedCSSStyleDeclaration", "Date",
|
||||
"Error", "EvalError", "Float32Array", "Float64Array", "Function",
|
||||
"HTMLDelElement", "HTMLInsElement", "Infinity",
|
||||
"HTMLDelElement", "HTMLInsElement", "HTMLSpanElement", "Infinity",
|
||||
"InnerModalContentWindow", "InnerWindow", "Int16Array", "Int32Array",
|
||||
"Int8Array", "InternalError", "Iterator", "JSON", "KeyboardEvent",
|
||||
"Math", "NaN", "Namespace", "Number", "Object", "Proxy", "QName",
|
||||
@@ -635,9 +635,10 @@ var JavaScript = Module("javascript", {
|
||||
"StopIteration", "String", "SyntaxError", "TypeError", "URIError",
|
||||
"Uint16Array", "Uint32Array", "Uint8Array", "XML",
|
||||
"XMLHttpProgressEvent", "XMLList", "XMLSerializer", "XPCNativeWrapper",
|
||||
"XPCSafeJSWrapper", "XULControllers", "decodeURI", "decodeURIComponent",
|
||||
"encodeURI", "encodeURIComponent", "escape", "eval", "isFinite", "isNaN",
|
||||
"isXMLName", "parseFloat", "parseInt", "undefined", "unescape", "uneval"
|
||||
"XPCSafeJSWrapper", "XULControllers", "constructor", "decodeURI",
|
||||
"decodeURIComponent", "encodeURI", "encodeURIComponent", "escape",
|
||||
"eval", "isFinite", "isNaN", "isXMLName", "parseFloat", "parseInt",
|
||||
"undefined", "unescape", "uneval"
|
||||
].concat([k.substr(6) for (k in keys(Ci)) if (/^nsIDOM/.test(k))])
|
||||
.concat([k.substr(3) for (k in keys(Ci)) if (/^nsI/.test(k))])
|
||||
.concat(this.magicalNames)
|
||||
|
||||
Reference in New Issue
Block a user