mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 16:47:59 +01:00
Fix unduly early loading of the commandline module.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -253,6 +253,7 @@ var Overlay = Module("Overlay", {
|
||||
catch (e) {
|
||||
Class.replaceProperty(modules, module.className, obj);
|
||||
}
|
||||
loaded[module.className] = true;
|
||||
|
||||
frob(module.className);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user