marijnh/CodeMirror2 — Issue #201: Get and set position/ranges/selections by character index
Author: soniciq
Created: 2011-10-09 14:17:40+00:00
State: open

Hi,

I'm sure this is probably an obvious question but I'll ask it anyway...

I need to be able to get and set positions/ranges/selections based on the number of characters from the start of the text. I know you can do this with getCursor, setCursor, getRange, replaceRange, setSelection, however you have to specify line and char. Is there a way do just use an index (which is the common way to work with strings), otherwise it means having to somehow convert an index to a line/char combination?

Thanks in advance... I'm loving CodeMirror 2.