mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-04 10:34:55 +02:00
8edad826ca
This begins a big refactor of moving more code out of the Gui struct into contexts, controllers, and helpers. We also move some code into structs in the gui package purely for the sake of better encapsulation
15 lines
539 B
Go
15 lines
539 B
Go
package controllers
|
|
|
|
import "github.com/jesseduffield/lazygit/pkg/gui/types"
|
|
|
|
func AttachControllers(context types.Context, controllers ...types.IController) {
|
|
for _, controller := range controllers {
|
|
context.AddKeybindingsFn(controller.GetKeybindings)
|
|
context.AddMouseKeybindingsFn(controller.GetMouseKeybindings)
|
|
context.AddOnClickFn(controller.GetOnClick())
|
|
context.AddOnRenderToMainFn(controller.GetOnRenderToMain())
|
|
context.AddOnFocusFn(controller.GetOnFocus())
|
|
context.AddOnFocusLostFn(controller.GetOnFocusLost())
|
|
}
|
|
}
|