From 138be04e6575f2bd087630e49d122af578c78bf6 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sat, 29 Jan 2022 19:09:20 +1100 Subject: refactor contexts code --- pkg/gui/patch_options_panel.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'pkg/gui/patch_options_panel.go') diff --git a/pkg/gui/patch_options_panel.go b/pkg/gui/patch_options_panel.go index 5c321819a..8f8615e4a 100644 --- a/pkg/gui/patch_options_panel.go +++ b/pkg/gui/patch_options_panel.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/jesseduffield/lazygit/pkg/commands/types/enums" - "github.com/jesseduffield/lazygit/pkg/gui/popup" "github.com/jesseduffield/lazygit/pkg/gui/types" ) @@ -13,7 +12,7 @@ func (gui *Gui) handleCreatePatchOptionsMenu() error { return gui.c.ErrorMsg(gui.c.Tr.NoPatchError) } - menuItems := []*popup.MenuItem{ + menuItems := []*types.MenuItem{ { DisplayString: "reset patch", OnPress: gui.handleResetPatch, @@ -29,7 +28,7 @@ func (gui *Gui) handleCreatePatchOptionsMenu() error { } if gui.git.Patch.PatchManager.CanRebase && gui.git.Status.WorkingTreeState() == enums.REBASE_MODE_NONE { - menuItems = append(menuItems, []*popup.MenuItem{ + menuItems = append(menuItems, []*types.MenuItem{ { DisplayString: fmt.Sprintf("remove patch from original commit (%s)", gui.git.Patch.PatchManager.To), OnPress: gui.handleDeletePatchFromCommit, @@ -51,7 +50,7 @@ func (gui *Gui) handleCreatePatchOptionsMenu() error { menuItems = append( menuItems[:1], append( - []*popup.MenuItem{ + []*types.MenuItem{ { DisplayString: fmt.Sprintf("move patch to selected commit (%s)", selectedCommit.Sha), OnPress: gui.handleMovePatchToSelectedCommit, @@ -63,7 +62,7 @@ func (gui *Gui) handleCreatePatchOptionsMenu() error { } } - return gui.c.Menu(popup.CreateMenuOptions{Title: gui.c.Tr.PatchOptionsTitle, Items: menuItems}) + return gui.c.Menu(types.CreateMenuOptions{Title: gui.c.Tr.PatchOptionsTitle, Items: menuItems}) } func (gui *Gui) getPatchCommitIndex() int { @@ -142,7 +141,7 @@ func (gui *Gui) handleMovePatchIntoWorkingTree() error { } if gui.workingTreeHelper.IsWorkingTreeDirty() { - return gui.c.Ask(popup.AskOpts{ + return gui.c.Ask(types.AskOpts{ Title: gui.c.Tr.MustStashTitle, Prompt: gui.c.Tr.MustStashWarning, HandleConfirm: func() error { -- cgit v1.2.3