diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-01-26 03:36:34 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-01-26 03:36:34 -0500 |
commit | 0a7f399bf7658ca8a2bcc55ebb4af646162faa35 (patch) | |
tree | 499b2068a6f36a8535b3cf378a07a7936a11120e /common/content/modes.js | |
parent | 102fb67efff462160837ce733c8d542f91f8467a (diff) | |
download | pentadactyl-0a7f399bf7658ca8a2bcc55ebb4af646162faa35.tar.gz |
Use table tags in :addons and :downloads to better support :yank.
Diffstat (limited to 'common/content/modes.js')
-rw-r--r-- | common/content/modes.js | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/common/content/modes.js b/common/content/modes.js index 8904aeec..fe9b0275 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -119,12 +119,6 @@ var Modes = Module("modes", { input: true, ownsFocus: true }); - this.addMode("COMMAND_LINE", { - char: "c", - description: "Active when the command line is focused", - input: true - }); - this.addMode("EMBED", { input: true, @@ -160,18 +154,6 @@ var Modes = Module("modes", { input: true }); - // this._extended modes, can include multiple modes, and even main modes - this.addMode("EX", { - extended: true, - description: "Ex command mode, active when the command line is open for Ex commands", - input: true - }, { history: "command" }); - this.addMode("HINTS", { - extended: true, - description: "Active when selecting elements in QuickHint or ExtendedHint mode", - count: false, - ownsBuffer: true - }); this.addMode("INPUT_MULTILINE", { extended: true, hidden: true, @@ -180,11 +162,6 @@ var Modes = Module("modes", { this.addMode("LINE", { extended: true, hidden: true }); - this.addMode("PROMPT", { - extended: true, - description: "Active when a prompt is open in the command line", - input: true - }); this.push(this.NORMAL, 0, { enter: function (stack, prev) { @@ -214,9 +191,9 @@ var Modes = Module("modes", { _getModeMessage: function () { // when recording a macro let macromode = ""; - if (modes.recording) + if (this.recording) macromode = "recording"; - else if (modes.replaying) + else if (this.replaying) macromode = "replaying"; let val = this._modeMap[this._main].display(); @@ -317,13 +294,15 @@ var Modes = Module("modes", { } if (stack && stack.pop && stack.pop.params.leave) - stack.pop.params.leave(stack, this.topOfStack); + dactyl.trapErrors("leave", stack.pop.params, + stack, this.topOfStack); let push = mainMode != null && !(stack && stack.pop) && Modes.StackElement(this._main, this._extended, params, {}); if (push && this.topOfStack) { if (this.topOfStack.params.leave) - this.topOfStack.params.leave({ push: push }, push); + dactyl.trapErrors("leave", this.topOfStack.params, + { push: push }, push); for (let [id, { obj, prop }] in Iterator(this.boundProperties)) { if (!obj.get()) delete this.boundProperties[id]; @@ -332,7 +311,7 @@ var Modes = Module("modes", { } } - this.delayed.forEach(function ([fn, self]) fn.call(self)); + let delayed = this.delayed; this.delayed = []; let prev = stack && stack.pop || this.topOfStack; @@ -343,9 +322,14 @@ var Modes = Module("modes", { for (let { obj, prop, value } in values(this.topOfStack.saved)) obj[prop] = value; + this.show(); + + delayed.forEach(function ([fn, self]) dactyl.trapErrors(fn, self)); + if (this.topOfStack.params.enter && prev) - this.topOfStack.params.enter(push ? { push: push } : stack || {}, - prev); + dactyl.trapErrors("enter", this.topOfStack.params, + push ? { push: push } : stack || {}, + prev); dactyl.triggerObserver("modeChange", [oldMain, oldExtended], [this._main, this._extended], stack); this.show(); @@ -439,7 +423,7 @@ var Modes = Module("modes", { input: false, - passUnknown: false, + get passUnknown() this.input, get mask() this, |