1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 14:02:28 +01:00

refactor completion.command

This commit is contained in:
Doug Kearns
2008-11-14 15:10:36 +00:00
parent 46264ada8a
commit 45963ccc12

View File

@@ -893,19 +893,10 @@ function Completion() //{{{
command: function command(filter)
{
var completions = [];
if (!filter)
{
for (let command in commands)
completions.push([command.name, command.description]);
return [0, completions];
}
for (let command in commands)
completions.push([command.longNames, command.description]);
return [0, buildLongestStartingSubstring(completions, filter)];
return [0, [[c.name, c.description] for (c in commands)]];
else
return [0, this.filter([[c.longNames, c.description] for (c in commands)], filter, true)];
},
dialog: function dialog(filter) [0, this.filter(config.dialogs, filter)],