m.Display()
screen.ShowCursor(Count(m.message), h-1)
screen.Show()
- event := screen.PollEvent()
+ event := <-events
switch e := event.(type) {
case *tcell.EventKey:
m.Clear()
m.Display()
- event := screen.PollEvent()
+ event := <-events
switch e := event.(type) {
case *tcell.EventKey:
}
}
if len(suggestions) == 1 {
- m.response = strings.Join(dirs[:len(dirs)-1], "/") + "/" + suggestions[0]
+ if len(dirs) > 1 {
+ m.response = strings.Join(dirs[:len(dirs)-1], "/") + "/" + suggestions[0]
+ } else {
+ m.response = suggestions[0]
+ }
m.cursorx = Count(m.response)
}
}