I’m trying to achieve the following:
- Add a text marker to a section of text within CodeMirror.
- I add line classes to each line that the text marker covers.
- As I add more text I want more line classes to be added for new lines. This text can be typed in or pasted from the clipboard.
At the moment I’m using the Enter key KeyMap and check to see if the cursor is within a text marker. If so I add the line classes. However, this seems inefficient and I was wondering if the TextMarker can emit events to say it has changed, which I could then use to add or remove the line classes.