mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 15:46:26 -04:00
Remove unnecessary askForConfigFile indirection
This commit is contained in:
parent
9b1acce0fe
commit
a8834930a0
|
|
@ -142,19 +142,19 @@ func lazygitTitle() string {
|
|||
|___/ |___/ `
|
||||
}
|
||||
|
||||
func (self *StatusController) askForConfigFile(action func(file string) error) error {
|
||||
func (self *StatusController) editConfig() error {
|
||||
confPaths := self.c.GetConfig().GetUserConfigPaths()
|
||||
switch len(confPaths) {
|
||||
case 0:
|
||||
return errors.New(self.c.Tr.NoConfigFileFoundErr)
|
||||
case 1:
|
||||
return action(confPaths[0])
|
||||
return self.c.Helpers().Files.EditFiles(confPaths)
|
||||
default:
|
||||
menuItems := lo.Map(confPaths, func(path string, _ int) *types.MenuItem {
|
||||
return &types.MenuItem{
|
||||
Label: path,
|
||||
OnPress: func() error {
|
||||
return action(path)
|
||||
return self.c.Helpers().Files.EditFiles([]string{path})
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
@ -166,12 +166,6 @@ func (self *StatusController) askForConfigFile(action func(file string) error) e
|
|||
}
|
||||
}
|
||||
|
||||
func (self *StatusController) editConfig() error {
|
||||
return self.askForConfigFile(func(file string) error {
|
||||
return self.c.Helpers().Files.EditFiles([]string{file})
|
||||
})
|
||||
}
|
||||
|
||||
func (self *StatusController) showAllBranchLogs() {
|
||||
cmdObj := self.c.Git().Branch.AllBranchesLogCmdObj()
|
||||
task := types.NewRunPtyTask(cmdObj.GetCmd())
|
||||
|
|
|
|||
Loading…
Reference in a new issue