My cursor's doing the funny
I was working on a repl, and at some point, my cursor was at first halfway in a character, and then one character behind! (The functional cursor was in front of the visual cursor.) Why?
The Repl viewport acts funny on certain devices (I would know xD) and certain characters can muck things up. Try reloading the page and if that doesn’t help hit the button that organizes your code your you and it should work. If not submit a bug report! Cheers!
~ Ray <3
Did that line have some emojis? Emojis sometimes contain more than one character, but display visually as one character, making your cursor go weird (it's travelling further than what you see).
Also there might be invisible whitespace, like the zero width joiner.
"this contains a zwj".length // => 20