diff --git a/shared/naturalcrit/codeEditor/codeEditor.jsx b/shared/naturalcrit/codeEditor/codeEditor.jsx index 7a0b70fde..621e24f77 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.jsx +++ b/shared/naturalcrit/codeEditor/codeEditor.jsx @@ -33,8 +33,8 @@ const CodeEditor = createClass({ componentDidMount : function() { this.buildEditor(); - this.codeMirror.setValue(this.props.value); - this.codeMirror.clearHistory(); + const newDoc = CodeMirror.Doc(this.props.value, this.props.language); + this.codeMirror.swapDoc(newDoc); }, componentDidUpdate : function(prevProps) {