Skip to content

Commit e197984

Browse files
authored
Merge pull request #1902 from processing/bug/copying-files
[#1887][#1890] Swap Codemirror doc when file id changes
2 parents 13d6799 + ec278de commit e197984

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

client/modules/IDE/components/Editor.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,7 @@ class Editor extends React.Component {
212212
}
213213

214214
componentDidUpdate(prevProps) {
215-
if (
216-
this.props.file.content !== prevProps.file.content &&
217-
this.props.file.content !== this._cm.getValue()
218-
) {
215+
if (this.props.file.id !== prevProps.file.id) {
219216
const oldDoc = this._cm.swapDoc(this._docs[this.props.file.id]);
220217
this._docs[prevProps.file.id] = oldDoc;
221218
this._cm.focus();

0 commit comments

Comments
 (0)