diff --git a/common/content/browser.js b/common/content/browser.js index dcdd5b48..158ec690 100644 --- a/common/content/browser.js +++ b/common/content/browser.js @@ -252,7 +252,7 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), dactyl.open(homepages, { from: "homepage", where: dactyl.NEW_TAB }); }); - mappings.add(modes.all, [""], + mappings.add([modes.MAIN], [""], "Redraw the screen", function () { ex.redraw(); }); }, diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 5e488a8a..3eccba53 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1676,11 +1676,11 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }, mappings: function () { - mappings.add(modes.all, [""], + mappings.add([modes.MAIN], [""], "Open the introductory help page", function () { dactyl.help(); }); - mappings.add(modes.all, [""], + mappings.add([modes.MAIN], [""], "Open the single, consolidated help page", function () { ex.helpall(); }); diff --git a/common/content/mappings.js b/common/content/mappings.js index 26d67a23..f4a29d73 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -661,11 +661,14 @@ var Mappings = Module("mappings", { let args = { getMode: function (args) findMode(args["-mode"]), - iterate: function (args) { - let mainMode = this.getMode(args); + iterate: function (args, mainOnly) { + let modes = [this.getMode(args)]; + if (!mainOnly) + modes = modes.concat(modes[0].bases); + let seen = {}; // Bloody hell. --Kris - for (let mode in values([mainMode].concat(mainMode.bases))) + for (let [i, mode] in Iterator(modes)) for (let hive in mappings.hives.iterValues()) for (let map in array.iterValues(hive.getStack(mode))) for (let name in values(map.names)) @@ -673,7 +676,7 @@ var Mappings = Module("mappings", { yield { name: name, columns: [ - mode == mainMode ? "" : {mode.name}, + i === 0 ? "" : {mode.name}, hive == mappings.builtin ? "" : {hive.name} ], __proto__: map @@ -711,9 +714,11 @@ var Mappings = Module("mappings", { __proto__: args, name: [mode.char + "listk[eys]", mode.char + "lk"], iterateIndex: function (args) - let (self = this, prefix = mode.char == "n" ? "" : mode.char + "_") + let (self = this, prefix = /^[bCmn]$/.test(mode.char) ? "" : mode.char + "_", + tags = services["dactyl:"].HELP_TAGS) ({ helpTag: prefix + map.name, __proto__: map } - for (map in self.iterate(args))), + for (map in self.iterate(args, true)) + if (map.hive === mappings.builtin || set.has(tags, prefix + map.name))), description: "List all " + mode.name + " mode mappings along with their short descriptions", index: mode.char + "-map", getMode: function (args) mode, diff --git a/common/content/modes.js b/common/content/modes.js index 65523637..7e4eedb6 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -36,6 +36,7 @@ var Modes = Module("modes", { this.boundProperties = {}; this.addMode("BASE", { + char: "b", description: "The base mode for all other modes", bases: [], count: false @@ -47,6 +48,7 @@ var Modes = Module("modes", { count: false }); this.addMode("COMMAND", { + char: "C", description: "The base mode for most modes which accept commands rather than input" }); diff --git a/common/locale/en-US/index.xml b/common/locale/en-US/index.xml index 4d1f7ff6..99b3c79a 100644 --- a/common/locale/en-US/index.xml +++ b/common/locale/en-US/index.xml @@ -14,8 +14,16 @@ This file contains a list of all available commands, mappings and options. +

Base mode

+ +

Main mode

+ +

Input mode

+

Insert mode

+

Command mode

+

Normal mode

Visual mode