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")
|
strings.TrimRight(buf.String(), "\n")
|
||||||
cmd := exec.Command("notify-send", strings.TrimRight(buf.String(), "\n"))
|
cmd := exec.Command("notify-send", strings.TrimRight(buf.String(), "\n"))
|
||||||
cmd.Run()
|
cmd.Run()
|
||||||
go func(buf *strings.Builder) {
|
v.Clear()
|
||||||
input <- buf.String()
|
v.SetCursor(0, 0)
|
||||||
}(buf)
|
// go func(buf *strings.Builder) {
|
||||||
|
// input <- buf.String()
|
||||||
|
// }(buf)
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue