mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03: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:
1 parent
4fea011021
commit
7e1073a0ee
1 file changed
+4
@@ -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}
|
||||
|
||||
Reference in new issue
Block a user