1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 02:27:58 +01:00

Fix unduly early loading of the commandline module.

This commit is contained in:
Kris Maglione
2011-02-03 10:30:35 -05:00
parent b2358eb152
commit 8ac70cbaed
6 changed files with 15 additions and 13 deletions

View File

@@ -346,6 +346,7 @@ var Buffer = Module("buffer", {
util.timeout(function () {
statusline.updateBufferPosition();
statusline.updateZoomLevel();
if (loaded.commandline)
commandline.clear();
}, 500);
},

View File

@@ -589,18 +589,15 @@ var CommandLine = Module("commandline", {
get command() {
if (this.commandVisible && this.widgets.command)
return this._lastCommand = this.widgets.command[1];
return this._lastCommand;
return commands.lastCommand = this.widgets.command[1];
return commands.lastCommand;
},
set command(val) {
if (this.commandVisible && (modes.extended & modes.EX))
return this.widgets.command = val;
return this._lastCommand = val;
return commands.lastCommand = val;
},
get lastCommand() this._lastCommand || this.command,
set lastCommand(val) { this._lastCommand = val; },
clear: function clear() {
if (this.widgets.message && this.widgets.message[1] === this._lastClearable)
this.widgets.message = null;

View File

@@ -129,6 +129,9 @@ var Command = Class("Command", {
get helpTag() ":" + this.name,
get lastCommand() this._lastCommand || commandline.command,
set lastCommand(val) { this._lastCommand = val; },
/**
* Execute this command.
*

View File

@@ -369,13 +369,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
* See {@link CommandLine#echo}.
*/
echomsg: function (str, verbosity, flags) {
flags |= commandline.APPEND_TO_MESSAGES;
if (verbosity == null)
verbosity = 0; // verbosity level is exclusionary
if (options["verbose"] >= verbosity)
commandline.echo(str, commandline.HL_INFOMSG, flags);
commandline.echo(str, commandline.HL_INFOMSG,
flags | commandline.APPEND_TO_MESSAGES);
},
/**
@@ -455,7 +454,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
modifiers = modifiers || {};
if (!silent)
commandline.lastCommand = str.replace(/^\s*:\s*/, "");
commands.lastCommand = str.replace(/^\s*:\s*/, "");
let res = true;
for (let [command, args] in commands.parseCommands(str.replace(/^'(.*)'$/, "$1"))) {
if (command === null)
@@ -1484,6 +1483,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
M: ["Always show messages outside of the status line"]
},
setter: function (opts) {
if (loaded.commandline)
commandline.widgets.updateVisibility();
}
},

View File

@@ -1026,7 +1026,7 @@ unlet s:cpo_save
},
modes: function (dactyl, modules, window) {
const { commandline, modes } = modules;
const { modes } = modules;
modes.addMode("FILE_INPUT", {
extended: true,

View File

@@ -253,6 +253,7 @@ var Overlay = Module("Overlay", {
catch (e) {
Class.replaceProperty(modules, module.className, obj);
}
loaded[module.className] = true;
frob(module.className);