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
|
// bindings defined separately so handlers can reference mainView
|
||||||
mainView.Keybindings = []Binding{
|
mainView.Keybindings = []Binding{
|
||||||
Binding{gocui.KeyCtrlC, gocui.ModNone, quit},
|
{gocui.KeyCtrlC, gocui.ModNone, quit},
|
||||||
Binding{gocui.KeyArrowUp, gocui.ModNone, mainView.CursorUp},
|
{gocui.KeyArrowUp, gocui.ModNone, mainView.CursorUp},
|
||||||
Binding{gocui.KeyArrowDown, gocui.ModNone, mainView.CursorDown},
|
{gocui.KeyArrowDown, gocui.ModNone, mainView.CursorDown},
|
||||||
Binding{'r', gocui.ModNone, mainView.Refresh},
|
{'r', gocui.ModNone, mainView.Refresh},
|
||||||
Binding{gocui.KeyCtrlL, gocui.ModNone, mainView.Refresh},
|
{gocui.KeyCtrlL, gocui.ModNone, mainView.Refresh},
|
||||||
Binding{'k', gocui.ModNone, mainView.CursorUp},
|
{'k', gocui.ModNone, mainView.CursorUp},
|
||||||
Binding{'j', gocui.ModNone, mainView.CursorDown},
|
{'j', gocui.ModNone, mainView.CursorDown},
|
||||||
Binding{gocui.KeyDelete, gocui.ModNone, mainView.HandleDelete},
|
{gocui.KeyDelete, gocui.ModNone, mainView.HandleDelete},
|
||||||
Binding{'d', gocui.ModNone, mainView.HandleDelete},
|
{'d', gocui.ModNone, mainView.HandleDelete},
|
||||||
Binding{'t', gocui.ModNone, mainView.HandleTrust},
|
{'t', gocui.ModNone, mainView.HandleTrust},
|
||||||
}
|
}
|
||||||
infoView := &ViewController{
|
infoView := &ViewController{
|
||||||
Name: "info",
|
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 {
|
func (vc *ViewController) Refresh(g *gocui.Gui, v *gocui.View) error {
|
||||||
// TODO propper error handling?
|
// TODO proper error handling?
|
||||||
vc.StateCtrl.Fetch()
|
vc.StateCtrl.Fetch()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vc *ViewController) CursorUp(g *gocui.Gui, v *gocui.View) error {
|
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
|
current := vc.StateCtrl.State.GetData().Current
|
||||||
vc.StateCtrl.State.SetCurrentPeer(current - 1)
|
vc.StateCtrl.State.SetCurrentPeer(current - 1)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vc *ViewController) CursorDown(g *gocui.Gui, v *gocui.View) error {
|
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
|
current := vc.StateCtrl.State.GetData().Current
|
||||||
vc.StateCtrl.State.SetCurrentPeer(current + 1)
|
vc.StateCtrl.State.SetCurrentPeer(current + 1)
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue