mirror of https://github.com/Hilbis/Hilbish
fix: check for 0 length slice when splitting input for completions
parent
61914f8dc7
commit
f2ee600c28
|
@ -74,13 +74,20 @@ func splitForFile(str string) []string {
|
|||
|
||||
func fileComplete(query, ctx string, fields []string) ([]string, string) {
|
||||
q := splitForFile(ctx)
|
||||
path := ""
|
||||
if len(q) != 0 {
|
||||
path = q[len(q) - 1]
|
||||
}
|
||||
|
||||
return matchPath(q[len(q) - 1])
|
||||
return matchPath(path)
|
||||
}
|
||||
|
||||
func binaryComplete(query, ctx string, fields []string) ([]string, string) {
|
||||
q := splitForFile(ctx)
|
||||
query = ""
|
||||
if len(q) != 0 {
|
||||
query = q[len(q) - 1]
|
||||
}
|
||||
|
||||
var completions []string
|
||||
|
||||
|
|
Loading…
Reference in New Issue