1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

fix click handling

This commit is contained in:
Jesse Duffield
2022-02-27 11:42:22 +11:00
parent cf00949b85
commit 59d4df2a44
52 changed files with 499 additions and 259 deletions

View File

@ -14,6 +14,7 @@ type BaseContext struct {
keybindingsFns []types.KeybindingsFn
mouseKeybindingsFns []types.MouseKeybindingsFn
onClickFn func() error
focusable bool
@ -90,6 +91,16 @@ func (self *BaseContext) AddMouseKeybindingsFn(fn types.MouseKeybindingsFn) {
self.mouseKeybindingsFns = append(self.mouseKeybindingsFns, fn)
}
func (self *BaseContext) AddOnClickFn(fn func() error) {
if fn != nil {
self.onClickFn = fn
}
}
func (self *BaseContext) GetOnClick() func() error {
return self.onClickFn
}
func (self *BaseContext) GetMouseKeybindings(opts types.KeybindingsOpts) []*gocui.ViewMouseBinding {
bindings := []*gocui.ViewMouseBinding{}
for i := range self.mouseKeybindingsFns {