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 @@ -62,7 +62,19 @@ func (self *MainViewController) GetMouseKeybindings(opts types.KeybindingsOpts)
62
62
{
63
63
ViewName : self .context .GetViewName (),
64
64
Key : gocui .MouseLeft ,
65
- Handler : self .onClick ,
65
+ Handler : func (opts gocui.ViewMouseBindingOpts ) error {
66
+ if self .isFocused () {
67
+ return self .onClick (opts )
68
+ }
69
+
70
+ self .context .SetParentContext (self .otherContext .GetParentContext ())
71
+ self .c .Context ().Push (self .context , types.OnFocusOpts {
72
+ ClickedWindowName : self .context .GetWindowName (),
73
+ ClickedViewLineIdx : opts .Y ,
74
+ })
75
+
76
+ return nil
77
+ },
66
78
},
67
79
}
68
80
}
@@ -104,3 +116,7 @@ func (self *MainViewController) openSearch() error {
104
116
105
117
return nil
106
118
}
119
+
120
+ func (self * MainViewController ) isFocused () bool {
121
+ return self .c .Context ().Current ().GetKey () == self .context .GetKey ()
122
+ }
You can’t perform that action at this time.
0 commit comments