runes: Implement UnreadRune() and PeekRune() #2

Closed
amery wants to merge 2 commits from pr-amery-unreadrune into main
Showing only changes of commit 6e866caa75 - Show all commits
+2 -1
View File
@@ -168,7 +168,8 @@ func (b *Reader) ReadRune() (rune, int, error) {
// decode rune
r, l := utf8.DecodeRune(b.buf[b.cursor:])
// step over
b.cursor += l
// and remember for UnreadRune()
b.lastRuneSize = l