@@ -13,12 +13,13 @@ type BaseContext struct {
1313 windowName string
1414 onGetOptionsMap func () map [string ]string
1515
16- keybindingsFns []types.KeybindingsFn
17- mouseKeybindingsFns []types.MouseKeybindingsFn
18- onClickFn func () error
19- onRenderToMainFn func ()
20- onFocusFn onFocusFn
21- onFocusLostFn onFocusLostFn
16+ keybindingsFns []types.KeybindingsFn
17+ mouseKeybindingsFns []types.MouseKeybindingsFn
18+ onClickFn func () error
19+ onClickFocusedMainViewFn onClickFocusedMainViewFn
20+ onRenderToMainFn func ()
21+ onFocusFn onFocusFn
22+ onFocusLostFn onFocusLostFn
2223
2324 focusable bool
2425 transient bool
@@ -31,8 +32,9 @@ type BaseContext struct {
3132}
3233
3334type (
34- onFocusFn = func (types.OnFocusOpts )
35- onFocusLostFn = func (types.OnFocusLostOpts )
35+ onFocusFn = func (types.OnFocusOpts )
36+ onFocusLostFn = func (types.OnFocusLostOpts )
37+ onClickFocusedMainViewFn = func (mainViewName string , clickedLineIdx int ) error
3638)
3739
3840var _ types.IBaseContext = & BaseContext {}
@@ -144,10 +146,20 @@ func (self *BaseContext) AddOnClickFn(fn func() error) {
144146 }
145147}
146148
149+ func (self * BaseContext ) AddOnClickFocusedMainViewFn (fn onClickFocusedMainViewFn ) {
150+ if fn != nil {
151+ self .onClickFocusedMainViewFn = fn
152+ }
153+ }
154+
147155func (self * BaseContext ) GetOnClick () func () error {
148156 return self .onClickFn
149157}
150158
159+ func (self * BaseContext ) GetOnClickFocusedMainView () onClickFocusedMainViewFn {
160+ return self .onClickFocusedMainViewFn
161+ }
162+
151163func (self * BaseContext ) AddOnRenderToMainFn (fn func ()) {
152164 if fn != nil {
153165 self .onRenderToMainFn = fn
0 commit comments