1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Merge pull request #2819 from ZeroX-DG/feature/edit-from-preview

[Feature] Edit from preview
This commit is contained in:
Junyoung Choi
2019-03-21 01:23:11 +09:00
committed by GitHub
3 changed files with 42 additions and 0 deletions

View File

@@ -835,6 +835,9 @@ export default class CodeEditor extends React.Component {
ch: 1
}
this.editor.setCursor(cursor)
const top = this.editor.charCoords({line: num, ch: 0}, 'local').top
const middleHeight = this.editor.getScrollerElement().offsetHeight / 2
this.editor.scrollTo(null, top - middleHeight - 5)
}
focus () {