fix panic for empty completions
This commit is contained in:
1 parent
5f87cb2542
commit
751290ed9b
1 file changed
-8
@@ -200,10 +200,6 @@ func compCmd(acc []rune) (matches []string, longestAcc []rune) {
|
||||
s := string(acc)
|
||||
f := tokenize(s)
|
||||
|
||||
if len(f) == 0 || s[len(s)-1] == ' ' {
|
||||
f = append(f, "")
|
||||
}
|
||||
|
||||
var longest string
|
||||
|
||||
switch len(f) {
|
||||
@@ -243,10 +239,6 @@ func compShell(acc []rune) (matches []string, longestAcc []rune) {
|
||||
s := string(acc)
|
||||
f := strings.Fields(s)
|
||||
|
||||
if len(f) == 0 || s[len(s)-1] == ' ' {
|
||||
f = append(f, "")
|
||||
}
|
||||
|
||||
var longest string
|
||||
|
||||
switch len(f) {
|
||||
|
||||
Reference in new issue
Block a user