diff --git a/main.go b/main.go index 3af8723..10b1cba 100644 --- a/main.go +++ b/main.go @@ -68,16 +68,16 @@ func main() { } // bindings defined separately so handlers can reference mainView mainView.Keybindings = []Binding{ - Binding{gocui.KeyCtrlC, gocui.ModNone, quit}, - Binding{gocui.KeyArrowUp, gocui.ModNone, mainView.CursorUp}, - Binding{gocui.KeyArrowDown, gocui.ModNone, mainView.CursorDown}, - Binding{'r', gocui.ModNone, mainView.Refresh}, - Binding{gocui.KeyCtrlL, gocui.ModNone, mainView.Refresh}, - Binding{'k', gocui.ModNone, mainView.CursorUp}, - Binding{'j', gocui.ModNone, mainView.CursorDown}, - Binding{gocui.KeyDelete, gocui.ModNone, mainView.HandleDelete}, - Binding{'d', gocui.ModNone, mainView.HandleDelete}, - Binding{'t', gocui.ModNone, mainView.HandleTrust}, + {gocui.KeyCtrlC, gocui.ModNone, quit}, + {gocui.KeyArrowUp, gocui.ModNone, mainView.CursorUp}, + {gocui.KeyArrowDown, gocui.ModNone, mainView.CursorDown}, + {'r', gocui.ModNone, mainView.Refresh}, + {gocui.KeyCtrlL, gocui.ModNone, mainView.Refresh}, + {'k', gocui.ModNone, mainView.CursorUp}, + {'j', gocui.ModNone, mainView.CursorDown}, + {gocui.KeyDelete, gocui.ModNone, mainView.HandleDelete}, + {'d', gocui.ModNone, mainView.HandleDelete}, + {'t', gocui.ModNone, mainView.HandleTrust}, } infoView := &ViewController{ Name: "info", diff --git a/view.go b/view.go index 98d71b5..36289a9 100644 --- a/view.go +++ b/view.go @@ -92,20 +92,20 @@ func (v *ViewController) SetKeybindings(g *gocui.Gui) error { } func (vc *ViewController) Refresh(g *gocui.Gui, v *gocui.View) error { - // TODO propper error handling? + // TODO proper error handling? vc.StateCtrl.Fetch() return nil } func (vc *ViewController) CursorUp(g *gocui.Gui, v *gocui.View) error { - // TODO propper error handling? + // TODO proper error handling? current := vc.StateCtrl.State.GetData().Current vc.StateCtrl.State.SetCurrentPeer(current - 1) return nil } func (vc *ViewController) CursorDown(g *gocui.Gui, v *gocui.View) error { - // TODO propper error handling? + // TODO proper error handling? current := vc.StateCtrl.State.GetData().Current vc.StateCtrl.State.SetCurrentPeer(current + 1) return nil