mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 07:17:59 +01:00
Kill 'mapleader'.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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; });
|
||||
},
|
||||
|
||||
@@ -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>") });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<dt><k name="Tab"/></dt>
|
||||
<dd>Moves the focus to the next hintable element</dd>
|
||||
|
||||
<dt><k name="Leader"/></dt>
|
||||
<dt><k>\</k></dt>
|
||||
<dd>Temporarily treats all numbers (or other keys, depending on the
|
||||
value of <o>hintkeys</o>) as ordinary text</dd>
|
||||
|
||||
|
||||
@@ -395,25 +395,6 @@
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<Leader> \]]></tags>
|
||||
<strut/>
|
||||
<spec><![CDATA[<Leader>]]></spec>
|
||||
<description>
|
||||
<p>
|
||||
A pseudo-key which expands to the value of the <o>mapleader</o>
|
||||
option. For example, by default,
|
||||
</p>
|
||||
<code><ex>:map <k name="Leader"/>h</ex> <ex>:echo <str>Hello</str><k name="CR"/></ex></code>
|
||||
<p>works like</p>
|
||||
<code><ex>:map \h</ex> <ex>:echo <str>Hello</str><k name="CR"/></ex></code>
|
||||
<p>but after</p>
|
||||
<set opt="mapleader"><str>,</str></set>
|
||||
<p>it works like</p>
|
||||
<code><ex>:map ,h</ex> <ex>:echo <str>Hello</str><k name="CR"/></ex></code>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<h3 tag="map-examples">Mapping examples</h3>
|
||||
|
||||
<p>Make <k name="A-n" link="false"/> do the same as <k name="Down" link="false"/> in input <t>modes</t>:</p>
|
||||
|
||||
@@ -694,7 +694,7 @@
|
||||
<strut/>
|
||||
<type>&option.extendedhinttags.type;</type>
|
||||
<default>[asOTvVWy]:':-moz-any-link',area[href],img[src],iframe[src],
|
||||
[A]:[id],
|
||||
[A]:[id],a[name],
|
||||
[f]:body,
|
||||
[F]:body,code,div,html,p,pre,span,
|
||||
[iI]:img,
|
||||
@@ -1116,16 +1116,6 @@
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags>'ml' 'mapleader'</tags>
|
||||
<spec>'mapleader' 'ml'</spec>
|
||||
<type>&option.mapleader.type;</type>
|
||||
<default>&option.mapleader.default;</default>
|
||||
<description>
|
||||
<p>Defines the replacement keys for the <k name="Leader"/> pseudo-key.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags>'maxitems'</tags>
|
||||
<spec>'maxitems'</spec>
|
||||
|
||||
@@ -217,8 +217,8 @@
|
||||
still be used for this purpose. [b4]
|
||||
- 'loadplugins' is now a [regexplist] option rather than
|
||||
a boolean. [b2]
|
||||
- 'mapleader' is now an option rather than a :let
|
||||
variable. [b4]
|
||||
- 'mapleader' is no longer an option rather or a :let
|
||||
variable. [b4][rc2]
|
||||
- 'passkeys' is now a [sitemap] with key chain support rather
|
||||
than a [regexpmap]. [b6]
|
||||
- The precise format of 'sanitizeitems' has changed slightly. [b8]
|
||||
|
||||
Reference in New Issue
Block a user