INNER CODE UNIT · Go
func
asciimoo/wuzz · wuzz.go:498
func (e singleLineEditor) Edit(v *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier) {
switch {
case (ch != 0 || key == gocui.KeySpace) && mod == 0:
e.wuzzEditor.Edit(v, key, ch, mod)
// At the end of the line the default gcui editor adds a whitespace
// Force him to remove
ox, _ := v.Cursor()
if ox > 1 && ox >= len(v.Buffer())-2 {
v.EditDelete(false)
}
return
case key == gocui.KeyEnter:
return
case key == gocui.KeyArrowRight:
ox, _ := v.Cursor()
if ox >= len(v.Buffer())-1 {
return
}