mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Extract the tcell-to-gocui event conversion out of pollEvent
A following commit needs pollEvent to attach information from the replayed-event wrappers to the GocuiEvent it returns. With the conversion inlined there is no seam to do that in, because every branch of the type switch returns directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
4fea011021
commit
7e1073a0ee
|
|
@ -300,6 +300,10 @@ func (g *Gui) pollEvent() GocuiEvent {
|
|||
tev = <-Screen.EventQ()
|
||||
}
|
||||
|
||||
return gocuiEventFromTcellEvent(tev)
|
||||
}
|
||||
|
||||
func gocuiEventFromTcellEvent(tev tcell.Event) GocuiEvent {
|
||||
switch tev := tev.(type) {
|
||||
case *tcell.EventInterrupt:
|
||||
return GocuiEvent{Type: eventInterrupt}
|
||||
|
|
|
|||
Loading…
Reference in a new issue