We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb4fa1f commit 2766b2bCopy full SHA for 2766b2b
2 files changed
src/components/Editor/index.js
@@ -201,7 +201,10 @@ const Editor = React.createClass({
201
resizeBreakpointGutter(codeMirror);
202
debugGlobal("cm", codeMirror);
203
204
- if (this.props.sourceText) {
+ if (this.props.selectedSource) {
205
+ let sourceId = this.props.selectedSource.get("id");
206
+ this.editor.replaceDocument(getDocument(sourceId));
207
+ } else if (this.props.sourceText) {
208
this.setText(this.props.sourceText.get("text"));
209
}
210
},
src/utils/editor/source-editor.js
@@ -49,7 +49,10 @@ class SourceEditor {
49
50
51
destroy() {
52
- // No need to do anything.
+ // Unlink the current document.
53
+ if (this.editor.doc) {
54
+ this.editor.doc.cm = null;
55
+ }
56
57
58
get codeMirror(): any {
0 commit comments