mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-06 19:35:45 +01:00
Expand <leader> in feedkeys.
This commit is contained in:
@@ -669,6 +669,8 @@ var Events = Module("events", {
|
|||||||
if (quiet)
|
if (quiet)
|
||||||
commandline.quiet = quiet;
|
commandline.quiet = quiet;
|
||||||
|
|
||||||
|
keys = mappings.expandLeader(keys);
|
||||||
|
|
||||||
for (let [, evt_obj] in Iterator(events.fromString(keys))) {
|
for (let [, evt_obj] in Iterator(events.fromString(keys))) {
|
||||||
let now = Date.now();
|
let now = Date.now();
|
||||||
let key = events.toString(evt_obj);
|
let key = events.toString(evt_obj);
|
||||||
@@ -870,6 +872,7 @@ var Events = Module("events", {
|
|||||||
let out = [];
|
let out = [];
|
||||||
for (let match in util.regexp.iterate(/<.*?>?>|[^<]|<(?!.*>)/g, input)) {
|
for (let match in util.regexp.iterate(/<.*?>?>|[^<]|<(?!.*>)/g, input)) {
|
||||||
let evt_str = match[0];
|
let evt_str = match[0];
|
||||||
|
|
||||||
let evt_obj = { ctrlKey: false, shiftKey: false, altKey: false, metaKey: false,
|
let evt_obj = { ctrlKey: false, shiftKey: false, altKey: false, metaKey: false,
|
||||||
keyCode: 0, charCode: 0, type: "keypress" };
|
keyCode: 0, charCode: 0, type: "keypress" };
|
||||||
|
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ var Mappings = Module("mappings", {
|
|||||||
|
|
||||||
get userHives() this.allHives.filter(function (h) h !== this.builtin, this),
|
get userHives() this.allHives.filter(function (h) h !== this.builtin, this),
|
||||||
|
|
||||||
expandLeader: function expandLeader(keyString) keyString.replace(/<Leader>/i, options["mapleader"]),
|
expandLeader: function expandLeader(keyString) keyString.replace(/<Leader>/i, function () options["mapleader"]),
|
||||||
|
|
||||||
prefixes: Class.memoize(function () {
|
prefixes: Class.memoize(function () {
|
||||||
let list = Array.map("CASM", function (s) s + "-");
|
let list = Array.map("CASM", function (s) s + "-");
|
||||||
@@ -411,11 +411,11 @@ var Mappings = Module("mappings", {
|
|||||||
*
|
*
|
||||||
* @param {number[]} modes An array of modes to search.
|
* @param {number[]} modes An array of modes to search.
|
||||||
* @param {string} filter The filter string to match.
|
* @param {string} filter The filter string to match.
|
||||||
|
* @param {[MapHive]} hives The map hives to list. @optional
|
||||||
*/
|
*/
|
||||||
list: function (modes, filter, hives) {
|
list: function (modes, filter, hives) {
|
||||||
let modeSign = "";
|
let modeSign = modes.map(function (m) m.char || "").join("")
|
||||||
modes.filter(function (m) m.char).forEach(function (m) { modeSign += m.char; });
|
+ modes.map(function (m) !m.char ? " " + m.name : "").join("");
|
||||||
modes.filter(function (m) !m.char).forEach(function (m) { modeSign += " " + m.name; });
|
|
||||||
modeSign = modeSign.replace(/^ /, "");
|
modeSign = modeSign.replace(/^ /, "");
|
||||||
|
|
||||||
hives = (hives || mappings.userHives).map(function (h) [h, maps(h)])
|
hives = (hives || mappings.userHives).map(function (h) [h, maps(h)])
|
||||||
|
|||||||
Reference in New Issue
Block a user