react-codemirror2 icon indicating copy to clipboard operation
react-codemirror2 copied to clipboard

markText() method

Open VicenteVicente opened this issue 4 years ago • 1 comments

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!

VicenteVicente avatar Jun 01 '20 14:06 VicenteVicente

readOnly doesn't work:

editor.markText({line: 0, ch: 0}, {line: 0, ch: 26}, { readOnly:true });

any idea why?

johnnytolengo avatar Dec 24 '20 14:12 johnnytolengo