From ddb12ffbe2e6bca35de63490b4ddfff7c6185dba Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sun, 24 Oct 2021 18:03:10 -0400 Subject: [PATCH] Make sure initial tab loads with language for code highlighting --- shared/naturalcrit/codeEditor/codeEditor.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {