Editor properly empties text after hitting enter
Realized I could use v.SetCursor and v.Clear to easily control the view
This commit is contained in:
parent
06b23f99c8
commit
d93be2b37b
|
@ -142,9 +142,11 @@ func initKeybindings(g *gocui.Gui) error {
|
|||
strings.TrimRight(buf.String(), "\n")
|
||||
cmd := exec.Command("notify-send", strings.TrimRight(buf.String(), "\n"))
|
||||
cmd.Run()
|
||||
go func(buf *strings.Builder) {
|
||||
input <- buf.String()
|
||||
}(buf)
|
||||
v.Clear()
|
||||
v.SetCursor(0, 0)
|
||||
// go func(buf *strings.Builder) {
|
||||
// input <- buf.String()
|
||||
// }(buf)
|
||||
return nil
|
||||
}); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue