diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-19 19:15:29 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-19 19:15:29 +1000 |
commit | e91fb21233f1c725c34e03b43ac763d8b4c61889 (patch) | |
tree | 46384cc0d99080d1b0600ea8efdfd85ce795f66f /pkg/gui/options_menu_panel.go | |
parent | 768b9453f8cf6b6bc22191803e0e440c0827a43f (diff) |
add recent repos menu option
Diffstat (limited to 'pkg/gui/options_menu_panel.go')
-rw-r--r-- | pkg/gui/options_menu_panel.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/gui/options_menu_panel.go b/pkg/gui/options_menu_panel.go index 2da002b43..ac01ad03d 100644 --- a/pkg/gui/options_menu_panel.go +++ b/pkg/gui/options_menu_panel.go @@ -33,11 +33,11 @@ func (gui *Gui) getBindings(v *gocui.View) []*Binding { func (gui *Gui) handleCreateOptionsMenu(g *gocui.Gui, v *gocui.View) error { bindings := gui.getBindings(v) - handleOptionsMenuPress := func(index int) error { + handleMenuPress := func(index int) error { if bindings[index].Key == nil { return nil } - if index <= len(bindings) { + if index >= len(bindings) { return errors.New("Index is greater than size of bindings") } err := gui.handleMenuClose(g, v) @@ -47,5 +47,5 @@ func (gui *Gui) handleCreateOptionsMenu(g *gocui.Gui, v *gocui.View) error { return bindings[index].Handler(g, v) } - return gui.createMenu(bindings, handleOptionsMenuPress) + return gui.createMenu(bindings, handleMenuPress) } |