Make arrows work

This commit is contained in:
Timothy Warren 2021-03-30 14:11:36 -04:00
parent 5194fe1e9b
commit 4dfe797467

View File

@ -30,7 +30,13 @@ func New() *editor {
func (e *editor) ProcessKeypress() bool { func (e *editor) ProcessKeypress() bool {
var runes []rune var runes []rune
for ch, size := terminal.ReadKey(); size != 0; ch, size = terminal.ReadKey() { // for ch, size := terminal.ReadKey(); size != 0; ch, size = terminal.ReadKey() {
for i := 0; i < 3; i++ {
ch, size := terminal.ReadKey()
if size == 0 {
break
}
if ch == fn.Ctrl('q') { if ch == fn.Ctrl('q') {
// Clean up on exit // Clean up on exit
terminal.Write(terminal.ClearScreen + terminal.ResetCursor) terminal.Write(terminal.ClearScreen + terminal.ResetCursor)