CodeMirror: Is it possible to pass \ register a mode as a delegate function?

105 Views Asked by At


I need to change values of tokens dynamically, using custom mode that i wrote.
is it possible to change modes by passing delegate function of the mode, or maybe there is a better way.
I am implementing codemirror using angular 2.
thank you.

1

There are 1 best solutions below

1
On BEST ANSWER

Yes, you can wrap a mode to create another mode. See for example the yaml-frontmatter mode in the distribution, or the mode/multiplex and mode/overlay addons.