func flowLayout(g *gocui.Gui) error { views := g.Views() x := 0 for _, v := range views { w, h := v.Size() _, err := g.SetView(v.Name(), x, 0, x+w+1, h+1) if err != nil && err != gocui.ErrUnknownView { return err } x += w + 2 } return nil }