code editor: correctly detect tab-focus to reset scroll / cursor position

This commit is contained in:
jean-emmanuel 2025-05-19 17:19:53 +02:00
parent e5d5d0aa06
commit 54b7bf7a63
2 changed files with 7 additions and 2 deletions

View file

@ -4,6 +4,7 @@
- bug fixes
- keyboard: regression (1.27.5) breaking `velocity` property
- editor: retain scroll position in code editors
## 1.29.4

View file

@ -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)