diff options
-rw-r--r-- | common/content/mappings.js | 10 | ||||
-rw-r--r-- | common/modules/commands.jsm | 4 | ||||
-rw-r--r-- | common/tests/functional/testCommands.js | 16 |
3 files changed, 20 insertions, 10 deletions
diff --git a/common/content/mappings.js b/common/content/mappings.js index 6f1c81af..86ff72ca 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -746,16 +746,10 @@ var Mappings = Module("mappings", { }; }, javascript: function () { - JavaScript.setCompleter(mappings.get, + JavaScript.setCompleter([mappings.get, mappings.builtin.get], [ null, - function (context, obj, args) { - let mode = args[0]; - return array.flatten([ - [[name, map.description] for ([i, name] in Iterator(map.names))] - for (map in mappings.iterate(mode)) - ]); - } + function (context, obj, args) [[m.names, m.description] for (m in this.iterate(args[0]))] ]); }, options: function () { diff --git a/common/modules/commands.jsm b/common/modules/commands.jsm index c426c106..a7bfde9c 100644 --- a/common/modules/commands.jsm +++ b/common/modules/commands.jsm @@ -1545,7 +1545,9 @@ var Commands = Module("commands", { const { JavaScript, commands } = modules; JavaScript.setCompleter([commands.user.get, commands.user.remove], - [function () [[c.name, c.description] for (c in this)]]); + [function () [[c.names, c.description] for (c in this)]]); + JavaScript.setCompleter([commands.get], + [function () [[c.names, c.description] for (c in this.iterator())]]); }, mappings: function (dactyl, modules, window) { const { commands, mappings, modes } = modules; diff --git a/common/tests/functional/testCommands.js b/common/tests/functional/testCommands.js index 1d439861..e11a3cb3 100644 --- a/common/tests/functional/testCommands.js +++ b/common/tests/functional/testCommands.js @@ -312,7 +312,21 @@ var tests = { ["window", hasItems], ["window.", hasItems], ["window['", hasItems], - ["commands.get('", hasItems] + ["File('", hasItems], + ["File.expandPath('", hasItems], + "autocommands.user.get('", + ["commands.get('", hasItems], + ["commands.builtin.get('", hasItems], + ["highlight.get('", hasItems], + ["highlight.highlightNode(null, '", hasItems], + ["mappings.get(modes.NORMAL, '", hasItems], + // ["mappings.builtin.get(modes.NORMAL, '", hasItems], + ["options.get('", hasItems], + ["prefs.get('", hasItems], + ["prefs.defaults.get('", hasItems], + ["localPrefs.get('", hasItems], + ["localPrefs.defaults.get('", hasItems], + ["styles.system.get('", hasItems], ] }, jumps: { |