mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-07 20:53:31 +02:00
Relocate mappings.get function completer to COMPLETION section.
This commit is contained in:
@@ -323,6 +323,20 @@ function Mappings() //{{{
|
|||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
liberator.registerObserver("load_completion", function () {
|
liberator.registerObserver("load_completion", function () {
|
||||||
|
completion.setFunctionCompleter(mappings.get,
|
||||||
|
[
|
||||||
|
null,
|
||||||
|
function (context, obj, args)
|
||||||
|
{
|
||||||
|
let mode = args[0];
|
||||||
|
return util.Array.flatten(
|
||||||
|
[
|
||||||
|
[[name, map.description] for ([i, name] in Iterator(map.names))]
|
||||||
|
for ([i, map] in Iterator(user[mode].concat(main[mode])))
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
completion.userMapping = function userMapping(context, args, modes) {
|
completion.userMapping = function userMapping(context, args, modes) {
|
||||||
// FIXME: have we decided on a 'standard' way to handle this clash? --djk
|
// FIXME: have we decided on a 'standard' way to handle this clash? --djk
|
||||||
modes = modes || [modules.modes.NORMAL];
|
modes = modes || [modules.modes.NORMAL];
|
||||||
@@ -339,22 +353,6 @@ function Mappings() //{{{
|
|||||||
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
liberator.registerObserver("load_completion", function () {
|
|
||||||
completion.setFunctionCompleter(mappings.get,
|
|
||||||
[
|
|
||||||
null,
|
|
||||||
function (context, obj, args)
|
|
||||||
{
|
|
||||||
let mode = args[0];
|
|
||||||
return util.Array.flatten(
|
|
||||||
[
|
|
||||||
[[name, map.description] for ([i, name] in Iterator(map.names))]
|
|
||||||
for ([i, map] in Iterator(user[mode].concat(main[mode])))
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
// NOTE: just normal mode for now
|
// NOTE: just normal mode for now
|
||||||
|
|||||||
Reference in New Issue
Block a user