diff --git a/common/content/buffer.js b/common/content/buffer.js index dba367c1..5a07c88d 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -253,7 +253,7 @@ var Buffer = Module("buffer", { if (document.commandDispatcher.focusedWindow == webProgress.DOMWindow && this.dactylLoadCount++) util.timeout(function () { modes.reset(false); }, - dactyl.mode == modes.HINTS ? 500 : 0); + modes.main == modes.HINTS ? 500 : 0); } else if (flags & Ci.nsIWebProgressListener.STATE_STOP) { // Workaround for bugs 591425 and 606877, dactyl bug #81 diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 353d26d4..46befb3b 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -91,8 +91,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { * @property {number} The current main mode. * @see modes#mainModes */ - get mode() modes.main, - set mode(value) modes.main = value, + mode: Class.Property({ + get: deprecated("Please use modes.main instead", function mode() modes.main), + set: deprecated("Please use modes.main instead", function mode(val) modes.main = val), + }), get menuItems() Dactyl.getMenuItems(), diff --git a/common/content/editor.js b/common/content/editor.js index 906d6bb3..68d953e8 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -703,7 +703,7 @@ var Editor = Module("editor", { function ({ arg, count }) { let pos = editor.findCharForward(arg, Math.max(count, 1)); if (pos >= 0) - editor.moveToPosition(pos, true, dactyl.mode == modes.VISUAL); + editor.moveToPosition(pos, true, modes.main == modes.VISUAL); }, { arg: true, count: true }); @@ -712,7 +712,7 @@ var Editor = Module("editor", { function ({ arg, count }) { let pos = editor.findCharBackward(arg, Math.max(count, 1)); if (pos >= 0) - editor.moveToPosition(pos, false, dactyl.mode == modes.VISUAL); + editor.moveToPosition(pos, false, modes.main == modes.VISUAL); }, { arg: true, count: true }); @@ -721,7 +721,7 @@ var Editor = Module("editor", { function ({ arg, count }) { let pos = editor.findCharForward(arg, Math.max(count, 1)); if (pos >= 0) - editor.moveToPosition(pos - 1, true, dactyl.mode == modes.VISUAL); + editor.moveToPosition(pos - 1, true, modes.main == modes.VISUAL); }, { arg: true, count: true }); @@ -730,7 +730,7 @@ var Editor = Module("editor", { function ({ arg, count }) { let pos = editor.findCharBackward(arg, Math.max(count, 1)); if (pos >= 0) - editor.moveToPosition(pos + 1, false, dactyl.mode == modes.VISUAL); + editor.moveToPosition(pos + 1, false, modes.main == modes.VISUAL); }, { arg: true, count: true }); diff --git a/common/content/events.js b/common/content/events.js index 543f9b83..ac8a83c5 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -693,7 +693,7 @@ var Events = Module("events", { * The global escape key handler. This is called in ALL modes. */ onEscape: function () { - switch (dactyl.mode) { + switch (modes.main) { case modes.COMMAND_LINE: case modes.INSERT: case modes.OUTPUT_MULTILINE: @@ -784,7 +784,7 @@ var Events = Module("events", { // Huh? --djk onFocusChange: function onFocusChange(event) { // command line has its own focus change handler - if (dactyl.mode == modes.COMMAND_LINE) + if (modes.main == modes.COMMAND_LINE) return; function hasHTMLDocument(win) win && win.document && win.document instanceof HTMLDocument @@ -1015,14 +1015,14 @@ var Events = Module("events", { let controller = document.commandDispatcher.getControllerForCommand("cmd_copy"); let couldCopy = controller && controller.isCommandEnabled("cmd_copy"); - if (dactyl.mode == modes.VISUAL) { + if (modes.main == modes.VISUAL) { if (!couldCopy) modes.pop(); // Really not ideal. } else if (couldCopy) { if (modes.main == modes.TEXT_EDIT && !options["insertmode"]) modes.push(modes.VISUAL); - else if (dactyl.mode == modes.CARET) + else if (modes.main == modes.CARET) modes.push(modes.VISUAL); } }