Skip to content

Commit 7f4e87a

Browse files
authored
Merge pull request #1708 from namanarora00/cursor-reset
Removes setTimeout for setting cursor's position.
2 parents 80e066a + aa2bc5d commit 7f4e87a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

client/modules/IDE/components/Editor.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const beautifyHTML = beautifyJS.html;
6262
window.JSHINT = JSHINT;
6363
window.CSSLint = CSSLint;
6464
window.HTMLHint = HTMLHint;
65+
delete CodeMirror.keyMap.sublime['Shift-Tab'];
6566

6667
const IS_TAB_INDENT = false;
6768
const INDENTATION_AMOUNT = 2;
@@ -304,10 +305,8 @@ class Editor extends React.Component {
304305
} else if (mode === 'htmlmixed') {
305306
this._cm.doc.setValue(beautifyHTML(this._cm.doc.getValue(), beautifyOptions));
306307
}
307-
setTimeout(() => {
308-
this._cm.focus();
309-
this._cm.doc.setCursor({ line: currentPosition.line, ch: currentPosition.ch + INDENTATION_AMOUNT });
310-
}, 0);
308+
this._cm.focus();
309+
this._cm.doc.setCursor({ line: currentPosition.line, ch: currentPosition.ch + INDENTATION_AMOUNT });
311310
}
312311

313312
initializeDocuments(files) {

0 commit comments

Comments
 (0)