I’m trying to write a mode for a simple language. I managed most of the colouring with the tokenizer and the states.
However the code will come to codemirror as text, with no indentation/line breaks. I’d like to do those.
For example, I’d like to add a line break when it enters a state. What’s the best way to do that ?
I thought of using the command “newlineAndIndent” but I can’t figure out how the mode may access the codemirror object and I’m not sure it’s the best way to do it.
I’ve also defined an indent function in my mode and was hoping to use it, but I cannot find an example of how to use that.
Many thanks in advance !