mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 04:07:59 +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),
|
||||
"Not opening command line in non-command-line mode.");
|
||||
|
||||
commandline.clearMessage();
|
||||
this.messageCount = commandline.messageCount;
|
||||
modes.push(this.mode, this.extendedMode, this.closure);
|
||||
|
||||
this.widgets.active.commandline.collapsed = false;
|
||||
@@ -366,6 +366,8 @@ var CommandMode = Class("CommandMode", {
|
||||
if (!this.keepCommand || commandline.silent || commandline.quiet)
|
||||
commandline.hide();
|
||||
this[this.accepted ? "onSubmit" : "onCancel"](commandline.command);
|
||||
if (commandline.messageCount === this.messageCount)
|
||||
commandline.clearMessage();
|
||||
}, this);
|
||||
}
|
||||
},
|
||||
@@ -699,11 +701,14 @@ var CommandLine = Module("commandline", {
|
||||
* commandline.FORCE_MULTILINE - Forces the message to appear in
|
||||
* the MOW.
|
||||
*/
|
||||
messageCount: 0,
|
||||
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
|
||||
if (this._silent)
|
||||
return;
|
||||
|
||||
this.messageCount++;
|
||||
|
||||
highlightGroup = highlightGroup || this.HL_NORMAL;
|
||||
|
||||
if (flags & this.APPEND_TO_MESSAGES) {
|
||||
|
||||
Reference in New Issue
Block a user