From a8834930a0da182c8348843cd55c7957ac9f5bfd Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Wed, 24 Jun 2026 21:50:21 +0200 Subject: [PATCH] Remove unnecessary askForConfigFile indirection --- pkg/gui/controllers/status_controller.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkg/gui/controllers/status_controller.go b/pkg/gui/controllers/status_controller.go index cc2a725bd..e96d371ea 100644 --- a/pkg/gui/controllers/status_controller.go +++ b/pkg/gui/controllers/status_controller.go @@ -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())