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