mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Focus the editor after restoring a stored cursor position (#7628)
GitOrigin-RevId: d4564f14503957a0fc8a02cef21064777e2e961d
This commit is contained in:
@@ -50,4 +50,8 @@ export default CursorPositionAdapter = class CursorPositionAdapter {
|
||||
const position = EditorShareJsCodec.shareJsOffsetToRowColumn(offset, lines)
|
||||
return this.gotoLine(position.row + 1, position.column)
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.editor.focus()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +113,7 @@ export default CursorPositionManager = class CursorPositionManager {
|
||||
}
|
||||
const pos = this.localStorage(`doc.position.${this.doc_id}`) || {}
|
||||
this.adapter.setCursor(pos)
|
||||
return this.adapter.setEditorScrollPosition(pos)
|
||||
this.adapter.setEditorScrollPosition(pos)
|
||||
this.adapter.focus()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user