func nextView(g *gocui.Gui, v *gocui.View) error { if v.Name() == "apps" { return g.SetCurrentView("placeholders") } if v.Name() == "placeholders" { return g.SetCurrentView("apps") } return g.SetCurrentView("apps") }
func moveCursor(v *gocui.View, direction int) error { if v != nil { ox, oy := v.Origin() cx, cy := v.Cursor() err := v.SetCursor(cx, cy+direction) if v.Name() == "placeholders" { myViews.values.SetCursor(cx, cy+direction) } if err != nil && (direction == 1 || (direction == -1 && oy > 0)) { if v.Name() == "placeholders" { myViews.values.SetOrigin(ox, oy+direction) } if err := v.SetOrigin(ox, oy+direction); err != nil { return err } } } return nil }