mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-09 13:58:05 -05:00
Check if iview.context related functions are nil
This commit is contained in:
11
ui/iview.go
11
ui/iview.go
@@ -82,7 +82,9 @@ func (i *interactiveView) SelectionHandler(selrow int) {
|
||||
if i.visual {
|
||||
i.toggleVisualMode()
|
||||
}
|
||||
i.contextHandler(i.vrange.Start, i.vrange.End, selrow)
|
||||
if i.contextHandler != nil {
|
||||
i.contextHandler(i.vrange.Start, i.vrange.End, selrow)
|
||||
}
|
||||
}
|
||||
|
||||
func (i *interactiveView) exitVisualMode() {
|
||||
@@ -183,8 +185,11 @@ func (i *interactiveView) getHandler(s string) func(e *tcell.EventKey) *tcell.Ev
|
||||
return e
|
||||
},
|
||||
"openCtx": func(e *tcell.EventKey) *tcell.EventKey {
|
||||
i.contextOpener()
|
||||
return nil
|
||||
if i.contextOpener != nil {
|
||||
i.contextOpener()
|
||||
return nil
|
||||
}
|
||||
return e
|
||||
},
|
||||
}
|
||||
if val, ok := funcMap[s]; ok {
|
||||
|
||||
Reference in New Issue
Block a user