Sort commands before autocomplete

This commit is contained in:
Stuart Quin 2016-08-10 08:28:33 +01:00
parent 6f03cd8bc7
commit 70a1987cf7

View file

@ -34,7 +34,7 @@ class AutoComplete
return @getCompletion(() => @getCommandCompletion(cmd))
filterByPrefix: (commands, prefix) ->
commands.filter((f) => f.startsWith(prefix))
commands.sort().filter((f) => f.startsWith(prefix))
getCompletion: (completeFunc) ->
if @completions.length == 0
@ -51,7 +51,6 @@ class AutoComplete
return complete
getCommandCompletion: (command) ->
if @completions.length == 0
return @filterByPrefix(@commands, command)
getFilePathCompletion: (command, filePath) ->