mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 15:57:57 +01:00
Don't use modes.clear() to clear the last message and some collateral fixes.
This commit is contained in:
@@ -188,9 +188,7 @@ const Browser = Module("browser", {
|
||||
function () {
|
||||
window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils).redraw();
|
||||
commandline.widgets.message = null;
|
||||
if (modes.main != modes.COMMAND_LINE)
|
||||
commandline.widgets.command = null;
|
||||
commandline.clear();
|
||||
},
|
||||
{ argCount: "0" });
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ const Buffer = Module("buffer", {
|
||||
// called when the active document is scrolled
|
||||
_updateBufferPosition: function _updateBufferPosition() {
|
||||
statusline.updateBufferPosition();
|
||||
modes.show(); // Clear the status line.
|
||||
commandline.clear();
|
||||
},
|
||||
|
||||
onDOMContentLoaded: function onDOMContentLoaded(event) {
|
||||
@@ -273,7 +273,7 @@ const Buffer = Module("buffer", {
|
||||
util.timeout(function () {
|
||||
statusline.updateBufferPosition();
|
||||
statusline.updateZoomLevel();
|
||||
modes.show(); // Clear the status line.
|
||||
commandline.clear();
|
||||
}, 500);
|
||||
},
|
||||
// called at the very end of a page load
|
||||
@@ -295,7 +295,7 @@ const Buffer = Module("buffer", {
|
||||
if (ssli == 1)
|
||||
statusline.updateUrl();
|
||||
else if (ssli == 2)
|
||||
modes.show();
|
||||
commandline.clear();
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -404,6 +404,7 @@ const CommandLine = Module("commandline", {
|
||||
win.focus();
|
||||
|
||||
this._startHints = false;
|
||||
if (!(modes.extended & modes.OUTPUT_MULTILINE))
|
||||
modes.set(modes.COMMAND_LINE, modes.OUTPUT_MULTILINE);
|
||||
commandline.updateMorePrompt();
|
||||
},
|
||||
@@ -567,6 +568,13 @@ const CommandLine = Module("commandline", {
|
||||
return this._lastCommand = val;
|
||||
},
|
||||
|
||||
clear: function () {
|
||||
if (this.widgets.message && this.widgets.message[1] === this._lastClearable)
|
||||
this.widgets.message = null;
|
||||
if (modes.main != modes.COMMAND_LINE)
|
||||
this.widgets.command = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Displays the multi-line output of a command, preceded by the last
|
||||
* executed ex command string.
|
||||
@@ -638,21 +646,19 @@ const CommandLine = Module("commandline", {
|
||||
if (this.widgets.message && this.widgets.message[1] == this._lastEcho)
|
||||
this._echoMultiline(<span highlight="Message">{this._lastEcho}</span>,
|
||||
this.widgets.message[0]);
|
||||
this._lastEcho = (action == this._echoLine) && str;
|
||||
}
|
||||
|
||||
// TODO: this is all a bit convoluted - clean up.
|
||||
// assume that FORCE_MULTILINE output is fully styled
|
||||
if (!(flags & this.FORCE_MULTILINE) && !single
|
||||
&& (!this.widgets.mowContainer.collapsed || this.widgets.message && this.widgets.message[1] == this._lastEcho)) {
|
||||
|
||||
if (!(flags & this.FORCE_MULTILINE) && !this.widgets.mowContainer.collapsed) {
|
||||
highlightGroup += " Message";
|
||||
action = this._echoMultiline;
|
||||
}
|
||||
this._lastEcho = (action == this._echoLine) && str;
|
||||
}
|
||||
|
||||
if ((flags & this.FORCE_MULTILINE) || (/\n/.test(str) || typeof str == "xml") && !(flags & this.FORCE_SINGLELINE))
|
||||
action = this._echoMultiline;
|
||||
|
||||
this._lastClearable = action === this._echoLine && String(str);
|
||||
|
||||
if (action)
|
||||
action.call(this, str, highlightGroup, single);
|
||||
}),
|
||||
|
||||
@@ -638,7 +638,7 @@ const Events = Module("events", {
|
||||
else
|
||||
dactyl.echo("Waiting for page to load...", commandline.DISALLOW_MULTILINE);
|
||||
}
|
||||
modes.show();
|
||||
commandline.clear();
|
||||
|
||||
// TODO: allow macros to be continued when page does not fully load with an option
|
||||
let ret = (buffer.loaded == 1);
|
||||
|
||||
Reference in New Issue
Block a user