diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eb2eea7..e9dcca1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bug fixes - keyboard: regression (1.27.5) breaking `velocity` property + - editor: retain scroll position in code editors ## 1.29.4 diff --git a/src/client/ui/ui-code-editor.js b/src/client/ui/ui-code-editor.js index 83dc0f5f..087d09ae 100644 --- a/src/client/ui/ui-code-editor.js +++ b/src/client/ui/ui-code-editor.js @@ -153,8 +153,12 @@ class CodeEditor { this.editor.dirty = true }) - var pos = this.editor.getCursorPosition() - if (pos.row === undefined || pos.column === undefined) this.editor.gotoLine(0) + setTimeout(()=>{ + var pos = this.editor.getCursorPosition() + if (pos.row === undefined || pos.column === undefined) { + this.editor.gotoLine(0) + } + }) this.typing = false setCommandEnabled(this.editor, 'indent', false)