1
0
mirror of https://github.com/mum4k/termdash.git synced 2025-04-25 13:48:50 +08:00

Return nil for non-termdash events

This commit is contained in:
kvnxiao 2020-03-01 01:14:37 -05:00
parent f7578e54cc
commit 1e970dcacd
2 changed files with 4 additions and 4 deletions

View File

@ -186,9 +186,7 @@ func toTermdashEvents(event tcell.Event) []terminalapi.Event {
if termdashOk {
return []terminalapi.Event{mouseEvent}
} else {
return []terminalapi.Event{
terminalapi.NewErrorf("unknown tcell event type: %v", event),
}
return nil
}
case *tcell.EventResize:
return []terminalapi.Event{convResize(event)}

View File

@ -177,7 +177,9 @@ func (t *Terminal) pollEvents() {
events := toTermdashEvents(t.screen.PollEvent())
for _, ev := range events {
t.events.Push(ev)
if ev != nil {
t.events.Push(ev)
}
}
}
}