@@ -13,12 +13,13 @@ type BaseContext struct {
13
13
windowName string
14
14
onGetOptionsMap func () map [string ]string
15
15
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
22
23
23
24
focusable bool
24
25
transient bool
@@ -31,8 +32,9 @@ type BaseContext struct {
31
32
}
32
33
33
34
type (
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
36
38
)
37
39
38
40
var _ types.IBaseContext = & BaseContext {}
@@ -144,10 +146,20 @@ func (self *BaseContext) AddOnClickFn(fn func() error) {
144
146
}
145
147
}
146
148
149
+ func (self * BaseContext ) AddOnClickFocusedMainViewFn (fn onClickFocusedMainViewFn ) {
150
+ if fn != nil {
151
+ self .onClickFocusedMainViewFn = fn
152
+ }
153
+ }
154
+
147
155
func (self * BaseContext ) GetOnClick () func () error {
148
156
return self .onClickFn
149
157
}
150
158
159
+ func (self * BaseContext ) GetOnClickFocusedMainView () onClickFocusedMainViewFn {
160
+ return self .onClickFocusedMainViewFn
161
+ }
162
+
151
163
func (self * BaseContext ) AddOnRenderToMainFn (fn func ()) {
152
164
if fn != nil {
153
165
self .onRenderToMainFn = fn
0 commit comments