I'm wondering if CodeMirror supports defining token types more dynamically. For example, if I were to use CodeMirror to create English language sentences, a word in a sentence may be a verb or a noun in a way that a parser cannot infer statically; the information must be supplied by a user externally:
We saw her duck.
I've been pointed to
markText, but it feels like the wrong place to start. Even if I ended up using it, I may have to build a lot of the use case myself. Note that I need a token to stay of a given type until it's modified; optionally, I would also like an option to force the token to be deleted or replaced all at once, which means disallowing editing inside the token.