mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge pull request #4436 from karl-zylinski/utf8string-last-rune-bug
Fix for using `utf8string.at` with last rune index returning wrong rune
This commit is contained in:
@@ -66,7 +66,7 @@ at :: proc(s: ^String, i: int, loc := #caller_location) -> (r: rune) {
|
|||||||
return
|
return
|
||||||
|
|
||||||
case s.rune_count-1:
|
case s.rune_count-1:
|
||||||
r, s.width = utf8.decode_rune_in_string(s.contents)
|
r, s.width = utf8.decode_last_rune(s.contents)
|
||||||
s.rune_pos = i
|
s.rune_pos = i
|
||||||
s.byte_pos = _len(s.contents) - s.width
|
s.byte_pos = _len(s.contents) - s.width
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user