Skip to content

Commit d5b6a18

Browse files
committed
Remove setTimeout for setting cursor's position.
1 parent 80e066a commit d5b6a18

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

client/modules/IDE/components/Editor.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,8 @@ class Editor extends React.Component {
304304
} else if (mode === 'htmlmixed') {
305305
this._cm.doc.setValue(beautifyHTML(this._cm.doc.getValue(), beautifyOptions));
306306
}
307-
setTimeout(() => {
308-
this._cm.focus();
309-
this._cm.doc.setCursor({ line: currentPosition.line, ch: currentPosition.ch + INDENTATION_AMOUNT });
310-
}, 0);
307+
this._cm.focus();
308+
this._cm.doc.setCursor({ line: currentPosition.line, ch: currentPosition.ch + INDENTATION_AMOUNT });
311309
}
312310

313311
initializeDocuments(files) {

0 commit comments

Comments
 (0)