Is there a way to reset the state of the codemirror editor? My problem is that in certain circumstances the code
editor.dispatch({
changes: {
from: 0,
to: endPosition,
insert: str
}
})
does not display the new text in the editor, despite the fact that I’ve verified that str
and endPosition
are correct. In this situation, I would like to reset the editor state and then do the dispatch
.