mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 04:45:47 +02:00
37 lines
792 B
Go
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
|
|
}
|