Of course, I can call
clearHistory() directly after
setValue() but it would probably be better not to have a history entry created in the first place.
I could also set the history size to 0, but AFAIK that’s not possible.
What concrete problem are you trying to solve? Are you worried about the history data taking up memory? Setting
undoDepth to zero should work. As does calling
Thanks for your help.
Are you worried about the history data taking up memory?
Yes, I have multiple CodeMirror instances and the content can get quite large (100k lines+). Each update needs about 12 MB of memory.
Setting undoDepth to zero should work. As does calling clearHistory().
I hadn’t noticed
undoDepth in the docs, thanks! Calling
clearHistory() is what I do now, but that creates a history entry anyway, if only for a short time. And from reading the code, I understand that
undoDepth works like that too.