g.Update(func(g *gocui.Gui) error {
v, err := g.View("chat")
if err != nil {
log.Panicln(err)
}
//v.Clear()
buff, _ := getBuffView(g, v)
fmt.Fprint(v, "You: " + buff)
return nil
})
g.Update(func(g *gocui.Gui) error {
v, err := g.View("input")
if err != nil {
log.Panicln(err)
}
//var buff string
v.Clear()
return nil
})
but when i clear the buffer for the "input" view it adds like 3-4 spaces
also sometimes it doesn't send the whole buffer? like i type "test"
press enter but nothing appears on the screen. The getBuffView
function just uses the v.Buffer() and returns it.. I'm kinda new to go
so maybe i'm doing something wrong?
hi, i have this function