Browse Source

runes: fix ReadRune() to actually move the cursor

Signed-off-by: Alejandro Mery <amery@jpi.io>
pull/2/head
Alejandro Mery 1 year ago
parent
commit
6e866caa75
  1. 3
      runes/reader.go

3
runes/reader.go

@ -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

Loading…
Cancel
Save