X-Git-Url: https://git.donarmstrong.com/?p=dactyl.git;a=blobdiff_plain;f=common%2Fcontent%2Fmappings.js;h=f14b3d2f5fbbbf2a004b8396beaf926fc83824d6;hp=149f3fb86c170e264d2b03435e6e57e03b59b1f3;hb=5ebd29f56d17f62011cdd596b1d351947ee534ff;hpb=9044153cb63835e39b9de8ec4ade237c03e3888a diff --git a/common/content/mappings.js b/common/content/mappings.js index 149f3fb..f14b3d2 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -355,7 +355,7 @@ var Mappings = Module("mappings", { get userHives() this.allHives.filter(function (h) h !== this.builtin, this), - expandLeader: function expandLeader(keyString) keyString.replace(//i, function () options["mapleader"]), + expandLeader: deprecated("your brain", function expandLeader(keyString) keyString), prefixes: Class.Memoize(function () { let list = Array.map("CASM", function (s) s + "-"); @@ -365,8 +365,6 @@ var Mappings = Module("mappings", { }), expand: function expand(keys) { - keys = keys.replace(//i, options["mapleader"]); - if (!/<\*-/.test(keys)) var res = keys; else @@ -541,7 +539,7 @@ var Mappings = Module("mappings", { args["-builtin"] = true; if (!rhs) // list the mapping - mappings.list(mapmodes, mappings.expandLeader(lhs), hives); + mappings.list(mapmodes, lhs, hives); else { util.assert(args["-group"].modifiable, _("map.builtinImmutable")); @@ -659,7 +657,7 @@ var Mappings = Module("mappings", { commands.add([ch + "no[remap]"], "Map a key sequence without remapping keys" + modeDescription, function (args) { map(args, true); }, - update({}, opts)); + update({ deprecated: ":" + ch + "map -builtin" }, opts)); commands.add([ch + "unm[ap]"], "Remove a mapping" + modeDescription, @@ -828,18 +826,10 @@ var Mappings = Module("mappings", { function (context, obj, args) [[m.names, m.description] for (m in this.iterate(args[0]))] ]); }, - options: function initOptions(dactyl, modules, window) { - options.add(["mapleader", "ml"], - "Define the replacement keys for the pseudo-key", - "string", "\\", { - setter: function (value) { - if (this.hasChanged) - for (let hive in values(mappings.allHives)) - for (let stack in values(hive.stacks)) - delete stack.states; - return value; - } - }); + mappings: function initMappings(dactyl, modules, window) { + mappings.add([modes.COMMAND], + ["\\"], "Emits pseudo-key", + function () { events.feedkeys("") }); } });