File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,19 @@ func (self *MainViewController) GetMouseKeybindings(opts types.KeybindingsOpts)
50
50
{
51
51
ViewName : self .context .GetViewName (),
52
52
Key : gocui .MouseLeft ,
53
- Handler : self .onClick ,
53
+ Handler : func (opts gocui.ViewMouseBindingOpts ) error {
54
+ if self .isFocused () {
55
+ return self .onClick (opts )
56
+ }
57
+
58
+ self .context .SetParentContext (self .otherContext .GetParentContext ())
59
+ self .c .Context ().Push (self .context , types.OnFocusOpts {
60
+ ClickedWindowName : self .context .GetWindowName (),
61
+ ClickedViewLineIdx : opts .Y ,
62
+ })
63
+
64
+ return nil
65
+ },
54
66
},
55
67
}
56
68
}
@@ -80,3 +92,7 @@ func (self *MainViewController) onClick(opts gocui.ViewMouseBindingOpts) error {
80
92
}
81
93
return nil
82
94
}
95
+
96
+ func (self * MainViewController ) isFocused () bool {
97
+ return self .c .Context ().Current ().GetKey () == self .context .GetKey ()
98
+ }
You can’t perform that action at this time.
0 commit comments