Sort commands before autocomplete
This commit is contained in:
parent
6f03cd8bc7
commit
70a1987cf7
1 changed files with 2 additions and 3 deletions
|
|
@ -34,7 +34,7 @@ class AutoComplete
|
||||||
return @getCompletion(() => @getCommandCompletion(cmd))
|
return @getCompletion(() => @getCommandCompletion(cmd))
|
||||||
|
|
||||||
filterByPrefix: (commands, prefix) ->
|
filterByPrefix: (commands, prefix) ->
|
||||||
commands.filter((f) => f.startsWith(prefix))
|
commands.sort().filter((f) => f.startsWith(prefix))
|
||||||
|
|
||||||
getCompletion: (completeFunc) ->
|
getCompletion: (completeFunc) ->
|
||||||
if @completions.length == 0
|
if @completions.length == 0
|
||||||
|
|
@ -51,8 +51,7 @@ class AutoComplete
|
||||||
return complete
|
return complete
|
||||||
|
|
||||||
getCommandCompletion: (command) ->
|
getCommandCompletion: (command) ->
|
||||||
if @completions.length == 0
|
return @filterByPrefix(@commands, command)
|
||||||
return @filterByPrefix(@commands, command)
|
|
||||||
|
|
||||||
getFilePathCompletion: (command, filePath) ->
|
getFilePathCompletion: (command, filePath) ->
|
||||||
filePath = @expandTilde(filePath)
|
filePath = @expandTilde(filePath)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue