1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

refactor contexts code

This commit is contained in:
Jesse Duffield
2022-01-29 19:09:20 +11:00
parent 1a74ed3214
commit 138be04e65
60 changed files with 1154 additions and 602 deletions

View File

@ -3,7 +3,7 @@ package gui
import (
"fmt"
"github.com/jesseduffield/lazygit/pkg/gui/popup"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
)
@ -21,7 +21,7 @@ func (gui *Gui) handleCreateGitFlowMenu() error {
return func() error {
title := utils.ResolvePlaceholderString(gui.c.Tr.NewGitFlowBranchPrompt, map[string]string{"branchType": branchType})
return gui.c.Prompt(popup.PromptOpts{
return gui.c.Prompt(types.PromptOpts{
Title: title,
HandleConfirm: func(name string) error {
gui.c.LogAction(gui.c.Tr.Actions.GitFlowStart)
@ -33,9 +33,9 @@ func (gui *Gui) handleCreateGitFlowMenu() error {
}
}
return gui.c.Menu(popup.CreateMenuOptions{
return gui.c.Menu(types.CreateMenuOptions{
Title: "git flow",
Items: []*popup.MenuItem{
Items: []*types.MenuItem{
{
// not localising here because it's one to one with the actual git flow commands
DisplayString: fmt.Sprintf("finish branch '%s'", branch.Name),