From 714a1baa430b97057e469577a1004c5ac8f1902e Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 7 Apr 2026 07:31:34 +0200 Subject: [PATCH] Remove unused StartTicking and tickingMutex --- pkg/gocui/gui.go | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/pkg/gocui/gui.go b/pkg/gocui/gui.go index 646efc88a..b9ecd090a 100644 --- a/pkg/gocui/gui.go +++ b/pkg/gocui/gui.go @@ -5,7 +5,6 @@ package gocui import ( - "context" standardErrors "errors" "runtime" "strings" @@ -95,10 +94,6 @@ type ViewMouseBindingOpts struct { } type GuiMutexes struct { - // tickingMutex ensures we don't have two loops ticking. The point of 'ticking' - // is to refresh the gui rapidly so that loader characters can be animated. - tickingMutex sync.Mutex - ViewsMutex sync.Mutex } @@ -1595,30 +1590,6 @@ func (g *Gui) onFocus(ev *GocuiEvent) error { return nil } -func (g *Gui) StartTicking(ctx context.Context) { - go func() { - g.Mutexes.tickingMutex.Lock() - defer g.Mutexes.tickingMutex.Unlock() - ticker := time.NewTicker(time.Millisecond * 50) - defer ticker.Stop() - outer: - for { - select { - case <-ticker.C: - // I'm okay with having a data race here: there's no harm in letting one of these updates through - if g.suspended { - continue outer - } - return - case <-ctx.Done(): - return - case <-g.stop: - return - } - } - }() -} - func (g *Gui) Suspend() error { g.suspendedMutex.Lock() defer g.suspendedMutex.Unlock()