mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
refactor contexts code
This commit is contained in:
@ -7,9 +7,9 @@ import (
|
||||
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/types/enums"
|
||||
"github.com/jesseduffield/lazygit/pkg/constants"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/popup"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/presentation"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/style"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
)
|
||||
|
||||
@ -139,17 +139,17 @@ func (gui *Gui) askForConfigFile(action func(file string) error) error {
|
||||
case 1:
|
||||
return action(confPaths[0])
|
||||
default:
|
||||
menuItems := make([]*popup.MenuItem, len(confPaths))
|
||||
menuItems := make([]*types.MenuItem, len(confPaths))
|
||||
for i, file := range confPaths {
|
||||
i := i
|
||||
menuItems[i] = &popup.MenuItem{
|
||||
menuItems[i] = &types.MenuItem{
|
||||
DisplayString: file,
|
||||
OnPress: func() error {
|
||||
return action(confPaths[i])
|
||||
},
|
||||
}
|
||||
}
|
||||
return gui.c.Menu(popup.CreateMenuOptions{
|
||||
return gui.c.Menu(types.CreateMenuOptions{
|
||||
Title: gui.c.Tr.SelectConfigFile,
|
||||
Items: menuItems,
|
||||
HideCancel: true,
|
||||
|
Reference in New Issue
Block a user