diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-04-14 14:59:42 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-04-16 10:03:35 +0200 |
commit | 8a77e51576e70fe0d4d769df62df282f7259c3e6 (patch) | |
tree | afea91429ef32a7e8893b13e6edd252785f199ca /pkg/gui/popup | |
parent | 145795c0b07da129599506ac8827a16314456ac4 (diff) |
Remove PopupHandler index and mutex
It doesn't seem to be used.
Diffstat (limited to 'pkg/gui/popup')
-rw-r--r-- | pkg/gui/popup/popup_handler.go | 16 |
1 files changed, 0 insertions, 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, |