From 8a77e51576e70fe0d4d769df62df282f7259c3e6 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 14 Apr 2024 14:59:42 +0200 Subject: Remove PopupHandler index and mutex It doesn't seem to be used. --- pkg/gui/popup/popup_handler.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/pkg/gui/popup/popup_handler.go b/pkg/gui/popup/popup_handler.go index 1eb81e800..40a664c0e 100644 --- a/pkg/gui/popup/popup_handler.go +++ b/pkg/gui/popup/popup_handler.go @@ -8,13 +8,10 @@ import ( "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/gui/style" "github.com/jesseduffield/lazygit/pkg/gui/types" - "github.com/sasha-s/go-deadlock" ) type PopupHandler struct { *common.Common - index int - deadlock.Mutex createPopupPanelFn func(context.Context, types.CreatePopupPanelOpts) error onErrorFn func() error popContextFn func() error @@ -44,7 +41,6 @@ func NewPopupHandler( ) *PopupHandler { return &PopupHandler{ Common: common, - index: 0, createPopupPanelFn: createPopupPanelFn, onErrorFn: onErrorFn, popContextFn: popContextFn, @@ -93,10 +89,6 @@ func (self *PopupHandler) Error(err error) error { } func (self *PopupHandler) ErrorMsg(message string) error { - self.Lock() - self.index++ - self.Unlock() - // Need to set bold here explicitly; otherwise it gets cancelled by the red colouring. coloredMessage := style.FgRed.SetBold().Sprint(strings.TrimSpace(message)) if err := self.onErrorFn(); err != nil { @@ -111,10 +103,6 @@ func (self *PopupHandler) Alert(title string, message string) error { } func (self *PopupHandler) Confirm(opts types.ConfirmOpts) error { - self.Lock() - self.index++ - self.Unlock() - return self.createPopupPanelFn(context.Background(), types.CreatePopupPanelOpts{ Title: opts.Title, Prompt: opts.Prompt, @@ -124,10 +112,6 @@ func (self *PopupHandler) Confirm(opts types.ConfirmOpts) error { } func (self *PopupHandler) Prompt(opts types.PromptOpts) error { - self.Lock() - self.index++ - self.Unlock() - return self.createPopupPanelFn(context.Background(), types.CreatePopupPanelOpts{ Title: opts.Title, Prompt: opts.InitialContent, -- cgit v1.2.3