1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 22:24:13 +01:00

Relocate mappings.get function completer to COMPLETION section.

This commit is contained in:
Doug Kearns
2009-07-01 19:06:25 +10:00
parent c5e4ab7ad1
commit ddf3383619

View File

@@ -323,6 +323,20 @@ function Mappings() //{{{
/////////////////////////////////////////////////////////////////////////////{{{
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) {
// FIXME: have we decided on a 'standard' way to handle this clash? --djk
modes = modes || [modules.modes.NORMAL];
@@ -339,22 +353,6 @@ function Mappings() //{{{
////////////////////// 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 {
// NOTE: just normal mode for now