summaryrefslogtreecommitdiffstats
path: root/pkg/gui/list_context.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-23 10:13:56 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commitade54b38c12079ba133e9c8810af2a3760afb0f3 (patch)
tree791315bd05894635ac0dee3f0e6b9c1acbea8f90 /pkg/gui/list_context.go
parent0dd2c869a8808e937c69f8ce0ba04015e5a9075e (diff)
cleanup
Diffstat (limited to 'pkg/gui/list_context.go')
-rw-r--r--pkg/gui/list_context.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/pkg/gui/list_context.go b/pkg/gui/list_context.go
index d3894d7a3..23a96952d 100644
--- a/pkg/gui/list_context.go
+++ b/pkg/gui/list_context.go
@@ -232,13 +232,12 @@ func (lc *ListContext) onSearchSelect(selectedLineIdx int) error {
func (gui *Gui) menuListContext() *ListContext {
return &ListContext{
- ViewName: "menu",
- ContextKey: "menu",
- GetItemsLength: func() int { return gui.getMenuView().LinesHeight() },
- GetPanelState: func() IListPanelState { return gui.State.Panels.Menu },
- OnFocus: gui.handleMenuSelect,
- // need to add a layer of indirection here because the callback changes during runtime
- OnClickSelectedItem: func() error { return gui.State.Panels.Menu.OnPress() },
+ ViewName: "menu",
+ ContextKey: "menu",
+ GetItemsLength: func() int { return gui.getMenuView().LinesHeight() },
+ GetPanelState: func() IListPanelState { return gui.State.Panels.Menu },
+ OnFocus: gui.handleMenuSelect,
+ OnClickSelectedItem: func() error { return gui.onMenuPress() },
Gui: gui,
ResetMainViewOriginOnFocus: false,
Kind: PERSISTENT_POPUP,