jroimartin / gocui

Minimalist Go package aimed at creating Console User Interfaces.
BSD 3-Clause "New" or "Revised" License
9.92k stars 608 forks source link

v.Clear() adds some random spaces? #155

Closed elf64 closed 6 years ago

elf64 commented 6 years ago

hi, i have this function


    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?