Browse Source

Cleanup errors

pull/1/head
Gregory Rudolph 5 years ago
parent
commit
7894dbe286
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 11
      main.go

11
main.go

@ -21,7 +21,7 @@ func main() {
kbtui, err := gocui.NewGui(gocui.OutputNormal) kbtui, err := gocui.NewGui(gocui.OutputNormal)
if err != nil { if err != nil {
log.Panicln(err) log.Printf(err.Error())
} }
defer kbtui.Close() defer kbtui.Close()
kbtui.SetManagerFunc(layout) kbtui.SetManagerFunc(layout)
@ -30,17 +30,17 @@ func main() {
go populateList(kbtui) go populateList(kbtui)
go updateChatWindow(kbtui) go updateChatWindow(kbtui)
if err := initKeybindings(kbtui); err != nil { if err := initKeybindings(kbtui); err != nil {
log.Fatalln(err) log.Printf(err.Error())
} }
if err := kbtui.MainLoop(); err != nil && err != gocui.ErrQuit { if err := kbtui.MainLoop(); err != nil && err != gocui.ErrQuit {
log.Panicln(err) log.Printf(err.Error())
} }
} }
func populateChat(g *gocui.Gui) { func populateChat(g *gocui.Gui) {
chat := k.NewChat(channel) chat := k.NewChat(channel)
maxX, _ := g.Size() maxX, _ := g.Size()
if api, err := chat.Read(maxX/2); err != nil { if api, err := chat.Read(maxX/2); err != nil {
log.Fatal(err) log.Printf(err.Error())
} else { } else {
var printMe []string var printMe []string
var actuallyPrintMe string var actuallyPrintMe string
@ -69,7 +69,7 @@ func sendChat(message string) {
func populateList(g *gocui.Gui) { func populateList(g *gocui.Gui) {
if testVar, err := k.ChatList(); err != nil { if testVar, err := k.ChatList(); err != nil {
log.Fatalln(err) log.Printf(err.Error())
} else { } else {
clearView(g, "List") clearView(g, "List")
for _, s := range testVar.Result.Conversations { for _, s := range testVar.Result.Conversations {
@ -142,7 +142,6 @@ func layout(g *gocui.Gui) error {
if err4 != gocui.ErrUnknownView { if err4 != gocui.ErrUnknownView {
return err4 return err4
} }
listView.Wrap = true
fmt.Fprintf(listView, "Lists\nWindow\nTo view\n activity") fmt.Fprintf(listView, "Lists\nWindow\nTo view\n activity")
} }
return nil return nil

Loading…
Cancel
Save