mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 13:52:26 +01:00
refactor completion.command
This commit is contained in:
@@ -893,19 +893,10 @@ function Completion() //{{{
|
|||||||
|
|
||||||
command: function command(filter)
|
command: function command(filter)
|
||||||
{
|
{
|
||||||
var completions = [];
|
|
||||||
|
|
||||||
if (!filter)
|
if (!filter)
|
||||||
{
|
return [0, [[c.name, c.description] for (c in commands)]];
|
||||||
for (let command in commands)
|
else
|
||||||
completions.push([command.name, command.description]);
|
return [0, this.filter([[c.longNames, c.description] for (c in commands)], filter, true)];
|
||||||
return [0, completions];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let command in commands)
|
|
||||||
completions.push([command.longNames, command.description]);
|
|
||||||
|
|
||||||
return [0, buildLongestStartingSubstring(completions, filter)];
|
|
||||||
},
|
},
|
||||||
|
|
||||||
dialog: function dialog(filter) [0, this.filter(config.dialogs, filter)],
|
dialog: function dialog(filter) [0, this.filter(config.dialogs, filter)],
|
||||||
|
|||||||
Reference in New Issue
Block a user