changed setImmediate with setTimeout

This commit is contained in:
ashu8912 2020-01-26 02:55:07 +05:30
parent 08f1c52f96
commit 5937af22f3

View file

@ -280,10 +280,10 @@ class Editor extends React.Component {
} else if (mode === 'htmlmixed') { } else if (mode === 'htmlmixed') {
this._cm.doc.setValue(beautifyHTML(this._cm.doc.getValue(), beautifyOptions)); this._cm.doc.setValue(beautifyHTML(this._cm.doc.getValue(), beautifyOptions));
} }
setImmediate(() => { setTimeout(() => {
this._cm.focus(); this._cm.focus();
this._cm.doc.setCursor({ line: currentPosition.line, ch: currentPosition.ch + INDENTATION_AMOUNT }); this._cm.doc.setCursor({ line: currentPosition.line, ch: currentPosition.ch + INDENTATION_AMOUNT });
}); }, 0);
} }
initializeDocuments(files) { initializeDocuments(files) {