diff --git a/common/content/commandline.js b/common/content/commandline.js index f9895d27..8ebe3769 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -423,14 +423,10 @@ const CommandLine = Module("commandline", { _keepCommand: Modes.boundProperty(), multilineInputVisible: Modes.boundProperty({ - set: function (value) { - this.widgets.multilineInput.collapsed = !value; - } + set: function (value) { this.widgets.multilineInput.collapsed = !value; } }), multilineOutputVisible: Modes.boundProperty({ - set: function (value) { - this.widgets.mowContainer.collapsed = !value; - } + set: function (value) { this.widgets.mowContainer.collapsed = !value; } }), /** @@ -445,9 +441,7 @@ const CommandLine = Module("commandline", { */ open: function open(prompt, cmd, extendedMode) { modes.push(modes.COMMAND_LINE, this.currentExtendedMode, { - leave: function (newMode) { - commandline.leave(newMode); - } + leave: commandline.closure.leave }); this.currentExtendedMode = extendedMode || null; @@ -729,10 +723,9 @@ const CommandLine = Module("commandline", { * @param {string} end * @param {function(string)} callbackFunc */ - // FIXME: Buggy, especially when pasting. Shouldn't use a RegExp. + // FIXME: Buggy, especially when pasting. inputMultiline: function inputMultiline(end, callbackFunc) { - // Kludge. - let cmd = !this.widgets.active.command.collapsed && this.command; + let cmd = this.command; modes.push(modes.COMMAND_LINE, modes.INPUT_MULTILINE); if (cmd != false) this._echoLine(cmd, this.HL_NORMAL); diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 59a1904f..f5295ff4 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -237,7 +237,7 @@ const Dactyl = Module("dactyl", { * @param {number} frames The number of frames to print. */ dumpStack: function dumpStack(msg, frames) { - let stack = Error().stack.replace(/(?:.*\n){2}/, ""); + let stack = Error().stack.replace(/(?:.*\n){1}/, ""); if (frames != null) [stack] = stack.match(RegExp("(?:.*\n){0," + frames + "}")); dactyl.dump((msg || "Stack") + "\n" + stack + "\n"); diff --git a/common/content/modes.js b/common/content/modes.js index a43dd977..254d3904 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -148,6 +148,9 @@ const Modes = Module("modes", { }, save: function (id, obj, prop) { + if (!(id in this.boundProperties)) + for (let elem in values(this._modeStack)) + elem.saved[id] = { obj: obj, prop: prop, value: obj[prop] }; this.boundProperties[id] = { obj: Cu.getWeakReference(obj), prop: prop }; }, @@ -258,10 +261,10 @@ const Modes = Module("modes", { return val === undefined ? value : val; }, set: function (val) { + modes.save(id, this, prop) if (desc.set) value = desc.set.call(this, val); value = !desc.set || value === undefined ? val : value; - modes.save(id, this, prop) } }) }, desc));