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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user