formatting and typos
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
5f425f9e30
commit
619a55b179
20
main.go
20
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",
|
||||
|
|
6
view.go
6
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
|
||||
|
|
Loading…
Reference in New Issue