File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 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)
5858 {
5959 ViewName : self .context .GetViewName (),
6060 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+ },
6274 },
6375 }
6476}
@@ -100,3 +112,7 @@ func (self *MainViewController) openSearch() error {
100112
101113 return nil
102114}
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