diff --git a/client/modules/IDE/components/Editor.jsx b/client/modules/IDE/components/Editor.jsx index b8e81650..ac10e8e5 100644 --- a/client/modules/IDE/components/Editor.jsx +++ b/client/modules/IDE/components/Editor.jsx @@ -271,6 +271,7 @@ class Editor extends React.Component { }; const mode = this._cm.getOption('mode'); + const currentPosition = this._cm.doc.getCursor(); if (mode === 'javascript') { this._cm.doc.setValue(beautifyJS(this._cm.doc.getValue(), beautifyOptions)); } else if (mode === 'css') { @@ -278,6 +279,7 @@ class Editor extends React.Component { } else if (mode === 'htmlmixed') { this._cm.doc.setValue(beautifyHTML(this._cm.doc.getValue(), beautifyOptions)); } + this._cm.doc.setCursor({ line: currentPosition.line, ch: currentPosition.ch }); } initializeDocuments(files) {