From 3e54932f7b1a1b39e31ebb919e427473f00dc723 Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Tue, 10 Feb 2015 12:04:19 -0800 Subject: [PATCH] Don't explode when autocompleting nothing. Fixes #126. --- host.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host.go b/host.go index ddaa260..ca17f70 100644 --- a/host.go +++ b/host.go @@ -199,7 +199,7 @@ func (h *Host) AutoCompleteFunction(u *message.User) func(line string, pos int, return } - if strings.HasSuffix(line[:pos], " ") { + if line == "" || strings.HasSuffix(line[:pos], " ") { // Don't autocomplete spaces. return }