mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-08 12:14:12 +01:00
Fix mappings when mode.addMode used after initialization.
--HG-- extra : rebase_source : 03fcc73999f01ef1987cf22c0061fbcfebf0bc23
This commit is contained in:
@@ -355,6 +355,15 @@ function Mappings() //{{{
|
|||||||
*/
|
*/
|
||||||
getUserIterator: function (mode) mappingsIterator(mode, user),
|
getUserIterator: function (mode) mappingsIterator(mode, user),
|
||||||
|
|
||||||
|
addMode: function (mode)
|
||||||
|
{
|
||||||
|
if (!(mode in user || mode in main))
|
||||||
|
{
|
||||||
|
main[mode] = [];
|
||||||
|
user[mode] = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a new default key mapping.
|
* Adds a new default key mapping.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -134,6 +134,8 @@ const modes = (function () //{{{
|
|||||||
modeMap[name].display = modeMap[name].display || function () disp;
|
modeMap[name].display = modeMap[name].display || function () disp;
|
||||||
if (!extended)
|
if (!extended)
|
||||||
mainModes.push(this[name]);
|
mainModes.push(this[name]);
|
||||||
|
if ("mappings" in modules)
|
||||||
|
mappings.addMode(this[name]);
|
||||||
},
|
},
|
||||||
|
|
||||||
getMode: function (name) modeMap[name],
|
getMode: function (name) modeMap[name],
|
||||||
|
|||||||
Reference in New Issue
Block a user