mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-06-06 02:13:07 +03:00
Merge pull request #70 from mvrilo/name-autocomplete
Lowercase prefix to tab-complete names with mixed case
This commit is contained in:
commit
8d50357dae
@ -252,11 +252,11 @@ func (s *Server) List(prefix *string) []string {
|
|||||||
s.RLock()
|
s.RLock()
|
||||||
defer s.RUnlock()
|
defer s.RUnlock()
|
||||||
|
|
||||||
for name := range s.clients {
|
for name, client := range s.clients {
|
||||||
if prefix != nil && !strings.HasPrefix(name, *prefix) {
|
if prefix != nil && !strings.HasPrefix(name, strings.ToLower(*prefix)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
r = append(r, name)
|
r = append(r, client.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
Loading…
x
Reference in New Issue
Block a user