Merge pull request #70 from mvrilo/name-autocomplete

Lowercase prefix to tab-complete names with mixed case
This commit is contained in:
Andrey Petrov 2014-12-17 15:33:57 -08:00
commit 8d50357dae

View File

@ -252,11 +252,11 @@ func (s *Server) List(prefix *string) []string {
s.RLock()
defer s.RUnlock()
for name := range s.clients {
if prefix != nil && !strings.HasPrefix(name, *prefix) {
for name, client := range s.clients {
if prefix != nil && !strings.HasPrefix(name, strings.ToLower(*prefix)) {
continue
}
r = append(r, name)
r = append(r, client.Name)
}
return r