1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-07 23:24:12 +01:00

Make 'mapleader' an option and fix the help fragment scrolling issue.

This commit is contained in:
Kris Maglione
2010-10-04 16:45:39 -04:00
parent 1d5eb0f991
commit 476c908da1
9 changed files with 34 additions and 22 deletions

View File

@@ -174,7 +174,7 @@ const Mappings = Module("mappings", {
}
},
_expandLeader: function (keyString) keyString.replace(/<Leader>/i, mappings.mapLeader),
_expandLeader: function (keyString) keyString.replace(/<Leader>/i, options["mapleader"]),
// Return all mappings present in all @modes
_mappingsIterator: function (modes, stack) {
@@ -289,15 +289,6 @@ const Mappings = Module("mappings", {
return matches;
},
/*
* @property {string} The map leader string used to replace the special
* token "<Leader>" when user mappings are defined.
*/
get mapLeader() dactyl.globalVariables["mapleader"] || "\\",
/** @deprecated */
getMapLeader: function () this.mapLeader,
/**
* Returns whether there is a user-defined mapping <b>cmd</b> for the
* specified <b>mode</b>.
@@ -589,6 +580,11 @@ const Mappings = Module("mappings", {
this._main[mode] = [];
this._user[mode] = [];
}
},
options: function () {
options.add(["mapleader", "ml"],
"Defines the replacement keys for the <Leader> pseudo-key",
"string", "\\");
}
});