Fix #185 - Terminate on RuneError

pull/189/head
Junegunn Choi 9 years ago
parent 3a9d1df026
commit 2d68cb8639

@ -7,6 +7,7 @@ CHANGELOG
### Bug fixes
- Fixed Unicode case handling (#186)
- Fixed to terminate on RuneError (#185)
0.9.7
-----

@ -420,6 +420,9 @@ func GetChar() Event {
return Event{int(_buf[0]), 0, nil}
}
r, rsz := utf8.DecodeRune(_buf)
if r == utf8.RuneError {
return Event{ESC, 0, nil}
}
sz = rsz
return Event{Rune, r, nil}
}

Loading…
Cancel
Save