lazygit/pkg/gui/controllers/global_controller.go
2023-04-30 13:19:53 +10:00

37 lines
792 B
Go

package controllers
import (
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
type GlobalController struct {
baseController
c *ControllerCommon
}
func NewGlobalController(
common *ControllerCommon,
) *GlobalController {
return &GlobalController{
baseController: baseController{},
c: common,
}
}
func (self *GlobalController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
return []*types.Binding{
{
Key: opts.GetKey(opts.Config.Universal.ExecuteCustomCommand),
Handler: self.customCommand,
Description: self.c.Tr.LcExecuteCustomCommand,
},
}
}
func (self *GlobalController) customCommand() error {
return (&CustomCommandAction{c: self.c}).Call()
}
func (self *GlobalController) Context() types.Context {
return nil
}