I’d like to be able to keep a textarea and the CodeMirror instance instantiated on it in sync (in terms of text content). I realize that cm.save()
will update the textarea from the current CodeMirror state, but what if I want to update CodeMirror to reflect the current content of the textarea? It seems like re-running fromTextArea()
does the trick, but I’m concerned this could be a heavyweight operation and even possibly lead to memory leaks.
Any suggestions? Thanks in advance.