diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-02-03 10:30:35 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-02-03 10:30:35 -0500 |
commit | 8ac70cbaed80d859a244dae15f3ea092391b5693 (patch) | |
tree | 693608e4f655dc379ee6dc6ce79ffd4d8ea10932 | |
parent | b2358eb1527ce4042612c095ff21a8ee834948de (diff) | |
download | pentadactyl-8ac70cbaed80d859a244dae15f3ea092391b5693.tar.gz |
Fix unduly early loading of the commandline module.
-rw-r--r-- | common/content/buffer.js | 3 | ||||
-rw-r--r-- | common/content/commandline.js | 9 | ||||
-rw-r--r-- | common/content/commands.js | 3 | ||||
-rw-r--r-- | common/content/dactyl.js | 10 | ||||
-rw-r--r-- | common/modules/io.jsm | 2 | ||||
-rw-r--r-- | common/modules/overlay.jsm | 1 |
6 files changed, 15 insertions, 13 deletions
diff --git a/common/content/buffer.js b/common/content/buffer.js index a84c3bd0..6338d4e6 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -346,7 +346,8 @@ var Buffer = Module("buffer", { util.timeout(function () { statusline.updateBufferPosition(); statusline.updateZoomLevel(); - commandline.clear(); + if (loaded.commandline) + commandline.clear(); }, 500); }, // called at the very end of a page load diff --git a/common/content/commandline.js b/common/content/commandline.js index 9054ebfc..ede78db6 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -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; diff --git a/common/content/commands.js b/common/content/commands.js index d8831b95..131589e0 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -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. * diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 843d438e..d2b4510f 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -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,7 +1483,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { M: ["Always show messages outside of the status line"] }, setter: function (opts) { - commandline.widgets.updateVisibility(); + if (loaded.commandline) + commandline.widgets.updateVisibility(); } }, { diff --git a/common/modules/io.jsm b/common/modules/io.jsm index 4c719c4c..3e85b02d 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -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, diff --git a/common/modules/overlay.jsm b/common/modules/overlay.jsm index 3e3477b2..6aa866a3 100644 --- a/common/modules/overlay.jsm +++ b/common/modules/overlay.jsm @@ -253,6 +253,7 @@ var Overlay = Module("Overlay", { catch (e) { Class.replaceProperty(modules, module.className, obj); } + loaded[module.className] = true; frob(module.className); |