Multiple editing surfaces, one command history

I see where you’re coming from. In my case, however, I don’t foresee needing to make non-history changes (unless there are some trivial/common non-history changes I’m not thinking of), nor do I intend to undo multiple steps at a time with backToVersion. I could see the version-based approach working, but it does make redo a lot more complicated. An alternative, though more involved, solution could be to forego the built-in history completely and simply subscribe to transform events from the editor and store Doc instances from tr.before and tr.after. Then just replace the editor’s document as needed.