diff --git a/common/content/commandline.js b/common/content/commandline.js index 2b57cc6f..12a156b5 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -1503,10 +1503,6 @@ var CommandLine = Module("commandline", { "Number of messages to store in the :messages history", "number", 100, { validator: function (value) value >= 0 }); - - options.add(["showmode", "smd"], - "Show the current mode in the command line", - "boolean", true); }, sanitizer: function init_sanitizer() { sanitizer.addItem("commandline", { diff --git a/common/content/modes.js b/common/content/modes.js index 48adc218..6c302a18 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -53,8 +53,7 @@ var Modes = Module("modes", { this.addMode("NORMAL", { char: "n", description: "Active when nothing is focused", - bases: [this.COMMAND], - display: function () null + bases: [this.COMMAND] }); this.addMode("VISUAL", { char: "v", @@ -120,7 +119,7 @@ var Modes = Module("modes", { }); this.addMode("AUTOCOMPLETE", { description: "Active when an input autocomplete pop-up is active", - display: function () "INSERT (autocomplete)", + display: function () "AUTOCOMPLETE (insert)", bases: [this.INSERT] }); @@ -143,9 +142,10 @@ var Modes = Module("modes", { bases: [this.BASE], hidden: true, passthrough: true, - display: function () modes.getStack(1).main == modes.PASS_THROUGH - ? (modes.getStack(2).main.display() || modes.getStack(2).main.name) + " (next)" - : "PASS THROUGH (next)" + display: function () + (modes.getStack(1).main == modes.PASS_THROUGH + ? (modes.getStack(2).main.display() || modes.getStack(2).main.name) + : "PASS THROUGH") + " (next)" }, { // Fix me. preExecute: function (map) { if (modes.main == modes.QUOTE && map.name !== "") modes.pop(); }, @@ -268,7 +268,7 @@ var Modes = Module("modes", { // show the current mode string in the command line show: function show() { let msg = null; - if (options["showmode"]) + if (options.get("showmode").getKey(this.main.name, true)) msg = this._getModeMessage(); if (loaded.commandline) commandline.widgets.mode = msg || null; @@ -509,7 +509,7 @@ var Modes = Module("modes", { }, desc)); } }, { - mappings: function () { + mappings: function initMappings() { mappings.add([modes.BASE, modes.NORMAL], ["", ""], "Return to NORMAL mode", @@ -528,7 +528,13 @@ var Modes = Module("modes", { "Close the current popup", function () { events.feedkeys(""); }); }, - prefs: function () { + options: function initOptions() { + options.add(["showmode", "smd"], + "Show the current mode in the command line when it matches this expression", + "regexplist", "!^normal$", + { regexpFlags: "i" }); + }, + prefs: function initPrefs() { prefs.watch("accessibility.browsewithcaret", function () modes.onCaretChange.apply(modes, arguments)); } }); diff --git a/common/locale/en-US/options.xml b/common/locale/en-US/options.xml index cbb0bab3..6fdd17c7 100644 --- a/common/locale/en-US/options.xml +++ b/common/locale/en-US/options.xml @@ -1318,10 +1318,10 @@ 'nosmd' 'noshowmode' 'smd' 'showmode' 'showmode' 'smd' - boolean - on + regexplist + !^normal$ -

Show the current mode in the command line.

+

Show the current mode in the command line if it matches this expression.

diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS index 80a31f6f..79525949 100644 --- a/pentadactyl/NEWS +++ b/pentadactyl/NEWS @@ -131,6 +131,7 @@ * IMPORTANT option changes: - 'hinttags' and 'extendedhinttags' now treat their values as CSS selectors by default. [b6] + - 'showmode' is now a regexplist. [b6] - Option value quoting has changed. List options will no longer be split at quoted commas and the option name, operators, and = sign may no longer be quoted. This will break certain