1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-31 10:05:47 +01:00

Kill 'mapleader'.

This commit is contained in:
Kris Maglione
2012-02-01 09:51:00 -05:00
parent 7e3868c15e
commit c4b52258b7
7 changed files with 12 additions and 53 deletions

View File

@@ -372,8 +372,6 @@ var Events = Module("events", {
if (quiet)
commandline.quiet = quiet;
keys = mappings.expandLeader(keys);
for (let [, evt_obj] in Iterator(DOM.Event.parse(keys))) {
let now = Date.now();
let key = DOM.Event.stringify(evt_obj);

View File

@@ -722,7 +722,7 @@ var HintSession = Class("HintSession", CommandMode, {
* Display the current status to the user.
*/
updateStatusline: function _updateStatusline() {
statusline.inputBuffer = (this.escapeNumbers ? options["mapleader"] : "") +
statusline.inputBuffer = (this.escapeNumbers ? "\\" : "") +
(this.hintNumber ? this.getHintString(this.hintNumber) : "");
},
});
@@ -1266,7 +1266,7 @@ var Hints = Module("hints", {
"Delete the previous character",
function ({ self }) self.backspace());
bind(["<Leader>"],
bind(["\\"],
"Toggle hint filtering",
function ({ self }) { self.escapeNumbers = !self.escapeNumbers; });
},

View File

@@ -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(/<Leader>/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(/<leader>/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"));
@@ -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 <Leader> 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 <Leader> pseudo-key",
function () { events.feedkeys("<Leader>") });
}
});