mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 10:08:00 +01:00
Clear message when exiting command line mode if there has been no new output, rather than on entering. Fixes revision 3a1866fd970c.
This commit is contained in:
@@ -313,7 +313,7 @@ var CommandMode = Class("CommandMode", {
|
|||||||
dactyl.assert(isinstance(this.mode, modes.COMMAND_LINE),
|
dactyl.assert(isinstance(this.mode, modes.COMMAND_LINE),
|
||||||
"Not opening command line in non-command-line mode.");
|
"Not opening command line in non-command-line mode.");
|
||||||
|
|
||||||
commandline.clearMessage();
|
this.messageCount = commandline.messageCount;
|
||||||
modes.push(this.mode, this.extendedMode, this.closure);
|
modes.push(this.mode, this.extendedMode, this.closure);
|
||||||
|
|
||||||
this.widgets.active.commandline.collapsed = false;
|
this.widgets.active.commandline.collapsed = false;
|
||||||
@@ -366,6 +366,8 @@ var CommandMode = Class("CommandMode", {
|
|||||||
if (!this.keepCommand || commandline.silent || commandline.quiet)
|
if (!this.keepCommand || commandline.silent || commandline.quiet)
|
||||||
commandline.hide();
|
commandline.hide();
|
||||||
this[this.accepted ? "onSubmit" : "onCancel"](commandline.command);
|
this[this.accepted ? "onSubmit" : "onCancel"](commandline.command);
|
||||||
|
if (commandline.messageCount === this.messageCount)
|
||||||
|
commandline.clearMessage();
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -699,11 +701,14 @@ var CommandLine = Module("commandline", {
|
|||||||
* commandline.FORCE_MULTILINE - Forces the message to appear in
|
* commandline.FORCE_MULTILINE - Forces the message to appear in
|
||||||
* the MOW.
|
* the MOW.
|
||||||
*/
|
*/
|
||||||
|
messageCount: 0,
|
||||||
echo: function echo(data, highlightGroup, flags) {
|
echo: function echo(data, highlightGroup, flags) {
|
||||||
// dactyl.echo uses different order of flags as it omits the highlight group, change commandline.echo argument order? --mst
|
// dactyl.echo uses different order of flags as it omits the highlight group, change commandline.echo argument order? --mst
|
||||||
if (this._silent)
|
if (this._silent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this.messageCount++;
|
||||||
|
|
||||||
highlightGroup = highlightGroup || this.HL_NORMAL;
|
highlightGroup = highlightGroup || this.HL_NORMAL;
|
||||||
|
|
||||||
if (flags & this.APPEND_TO_MESSAGES) {
|
if (flags & this.APPEND_TO_MESSAGES) {
|
||||||
|
|||||||
Reference in New Issue
Block a user