From 751290ed9bd17ee192f2f695de37c089274e4586 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Thu, 15 Dec 2016 16:04:15 +0300 Subject: [PATCH] fix panic for empty completions --- comp.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/comp.go b/comp.go index e8cc184..e8725d4 100644 --- a/comp.go +++ b/comp.go @@ -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) {