Enable ctrl+l & ctrl+u support
This commit is contained in:
parent
7824a86a23
commit
66c8c81810
1 changed files with 16 additions and 0 deletions
16
main.go
16
main.go
|
@ -128,9 +128,25 @@ func main() {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
gui.SetKeybinding("", gocui.KeyCtrlL, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
chat, err := g.View("chat")
|
||||||
|
if err != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
chat.SetCursor(0, 0)
|
||||||
|
chat.Clear()
|
||||||
|
|
||||||
|
return nil
|
||||||
|
})
|
||||||
gui.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error {
|
gui.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
return gocui.ErrQuit
|
return gocui.ErrQuit
|
||||||
})
|
})
|
||||||
|
gui.SetKeybinding("input", gocui.KeyCtrlU, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
v.SetCursor(0, 0)
|
||||||
|
v.Clear()
|
||||||
|
return nil
|
||||||
|
})
|
||||||
gui.SetKeybinding("input", gocui.KeyEnter, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error {
|
gui.SetKeybinding("input", gocui.KeyEnter, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
msg := v.ViewBuffer()
|
msg := v.ViewBuffer()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue