mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-07-03 04:04:34 +02:00
formatting fixes
This commit is contained in:
parent
b346ccdeb7
commit
f07f7e78ab
@ -276,11 +276,11 @@ func (s *Server) Start(laddr string) error {
|
|||||||
func (s *Server) AutoCompleteFunction(line string, pos int, key rune) (newLine string, newPos int, ok bool) {
|
func (s *Server) AutoCompleteFunction(line string, pos int, key rune) (newLine string, newPos int, ok bool) {
|
||||||
if key == 9 {
|
if key == 9 {
|
||||||
shortLine := strings.Split(line[:pos], " ")
|
shortLine := strings.Split(line[:pos], " ")
|
||||||
partialNick := shortLine[len(shortLine) - 1]
|
partialNick := shortLine[len(shortLine)-1]
|
||||||
|
|
||||||
nicks := s.List(&partialNick)
|
nicks := s.List(&partialNick)
|
||||||
if len(nicks) > 0 {
|
if len(nicks) > 0 {
|
||||||
nick := nicks[len(nicks) - 1]
|
nick := nicks[len(nicks)-1]
|
||||||
posPartialNick := pos - len(partialNick)
|
posPartialNick := pos - len(partialNick)
|
||||||
|
|
||||||
newLine = strings.Replace(line[posPartialNick:],
|
newLine = strings.Replace(line[posPartialNick:],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user