1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2026-04-05 19:10:09 +02:00
Files
lazygit/pkg/gui/controllers/attach.go
blakemckeany 4567840198 Add GetOnClick to HasKeybindings
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>
2026-03-25 17:08:02 +01:00

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())
}
}