Reputation: 38
I'm experimenting with text annotation in CodeMirror.
What's the difference between using TextMarker
and Mode
?
It seems that both would be the job done, but the Mode
API seems more complicated.
Are there significant performance improvements with Mode
?
Upvotes: 0
Views: 322
Reputation: 8929
Yes, highlighting by a mode is computed on demand, whereas making all text in a document to have the right color requires you to do it yourself, and update it yourself whenever the document changes. For big documents, this is going to be very expensive.
Upvotes: 1