idude
idude

Reputation: 4922

CodeMirror MarkText

In the codemirror documentation, they have a method called markText (http://codemirror.net/doc/manual.html#api_marker). I have looked over the documentation and still do not understand what to do.

var word = CodeMirror.fromTextArea(document.getElementById('words'), {
    mode: "text/html",
});
word.markText({1,1},{3,1}, readOnly: true);

The code above does not seam to work. Please tell me how to correctly use the markText method.

Thanks in advance!

Upvotes: 6

Views: 7169

Answers (1)

idude
idude

Reputation: 4922

After some more thinking I found out how to do it.

word.markText({line:1,ch:1},{line:3,ch:1},{readOnly:true});

I simply forgot that it had to be an object. My bad.

Upvotes: 9

Related Questions