swapDoc v6 equivalent

Hi, is there an equivalent for the swapDoc() method on the cm instance? For context, I’m writing a note application that uses codemirror to edit multiple notes interchangeably and at the moment I’m just overwritting the editor content when the note is changed which means history overlaps between documents from the user’s perspective. Many thanks for any replies.

Store the editor states of the docs not in the view, and use setState to put a new state into an editor view.

1 Like