react-codemirror2
react-codemirror2 copied to clipboard
markText() method
Is the method markText() supported? If it's not, is it possible to make this method work, for example as a prop with a an array of "range objects", with keys start s
and end e
. i.e:
marks={[
{s: 0, e: 5},
{s:3, e: 6}
]}
So the default value would be marks={[]}
. I think this can be done by many other ways but this is mi proposal. Here's the original method of CodeMirror
doc.markText(from: {line, ch}, to: {line, ch}, ?options: object) → TextMarker
Can be used to mark a range of text with a specific CSS class name. from and to should be {line, ch} objects.
Thank you!
readOnly doesn't work:
editor.markText({line: 0, ch: 0}, {line: 0, ch: 26}, { readOnly:true });
any idea why?