mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 09:48:00 +01:00
refactor completion.command
This commit is contained in:
@@ -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)],
|
||||
|
||||
Reference in New Issue
Block a user