mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-27 10:03:13 +00:00
Focus the editor after restoring a stored cursor position (#7628)
GitOrigin-RevId: d4564f14503957a0fc8a02cef21064777e2e961d
This commit is contained in:
parent
e644c2a531
commit
b70e63e893
2 changed files with 6 additions and 1 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue