diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-28 20:44:36 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | a90b6efded49abcfa2516db794d7875b0396f558 (patch) | |
tree | ad9c3738830437064ada223f0978dab1d726b479 /pkg/gui/staging_panel.go | |
parent | fa8571e1f4c349e401542285ea238acdbd9d17ec (diff) |
start refactoring gui
Diffstat (limited to 'pkg/gui/staging_panel.go')
-rw-r--r-- | pkg/gui/staging_panel.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/pkg/gui/staging_panel.go b/pkg/gui/staging_panel.go index ecb208dcc..f4cd98ea2 100644 --- a/pkg/gui/staging_panel.go +++ b/pkg/gui/staging_panel.go @@ -4,6 +4,8 @@ import ( "strings" "github.com/jesseduffield/lazygit/pkg/commands/patch" + "github.com/jesseduffield/lazygit/pkg/gui/popup" + "github.com/jesseduffield/lazygit/pkg/gui/types" ) func (gui *Gui) refreshStagingPanel(forceSecondaryFocused bool, selectedLineIdx int) error { @@ -112,10 +114,10 @@ func (gui *Gui) handleResetSelection() error { } if !gui.UserConfig.Gui.SkipUnstageLineWarning { - return gui.ask(askOpts{ - title: gui.Tr.UnstageLinesTitle, - prompt: gui.Tr.UnstageLinesPrompt, - handleConfirm: func() error { + return gui.PopupHandler.Ask(popup.AskOpts{ + Title: gui.Tr.UnstageLinesTitle, + Prompt: gui.Tr.UnstageLinesPrompt, + HandleConfirm: func() error { return gui.withLBLActiveCheck(func(state *LblPanelState) error { return gui.applySelection(true, state) }) @@ -149,14 +151,14 @@ func (gui *Gui) applySelection(reverse bool, state *LblPanelState) error { gui.logAction(gui.Tr.Actions.ApplyPatch) err := gui.Git.WorkingTree.ApplyPatch(patch, applyFlags...) if err != nil { - return gui.surfaceError(err) + return gui.PopupHandler.Error(err) } if state.SelectingRange() { state.SetLineSelectMode() } - if err := gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{FILES}}); err != nil { + if err := gui.refreshSidePanels(types.RefreshOptions{Scope: []types.RefreshableView{types.FILES}}); err != nil { return err } if err := gui.refreshStagingPanel(false, -1); err != nil { |