File: attach.go

package info (click to toggle)
lazygit 0.50.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,808 kB
  • sloc: sh: 128; makefile: 76
file content (15 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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.AddOnClickFocusedMainViewFn(controller.GetOnClickFocusedMainView())
		context.AddOnRenderToMainFn(controller.GetOnRenderToMain())
		context.AddOnFocusFn(controller.GetOnFocus())
		context.AddOnFocusLostFn(controller.GetOnFocusLost())
	}
}