mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-14 17:35:45 +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;
|
||||
|
||||
Reference in New Issue
Block a user