mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-04-05 19:10:09 +02:00
Can be used for doing additional click handling in list views. Like the GetOnDoubleClick hook we should try to find a better design for this than putting it in HasKeybindings and BaseContext, since it is only used by list contexts. Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
17 lines
677 B
Go
17 lines
677 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.AddOnDoubleClickFn(controller.GetOnDoubleClick())
|
|
context.AddOnClickFn(controller.GetOnClick())
|
|
context.AddOnClickFocusedMainViewFn(controller.GetOnClickFocusedMainView())
|
|
context.AddOnRenderToMainFn(controller.GetOnRenderToMain())
|
|
context.AddOnFocusFn(controller.GetOnFocus())
|
|
context.AddOnFocusLostFn(controller.GetOnFocusLost())
|
|
}
|
|
}
|