From 7e1073a0ee1d8338bb1c3d39d3cbbd7eedbdacee Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Wed, 15 Jul 2026 14:32:48 +0200 Subject: [PATCH] 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 --- pkg/gocui/tcell_driver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/gocui/tcell_driver.go b/pkg/gocui/tcell_driver.go index 226ee0580..857e35bfc 100644 --- a/pkg/gocui/tcell_driver.go +++ b/pkg/gocui/tcell_driver.go @@ -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}