( view: EditorView, scrollTop?: number, scrollLeft?: number, )
| 66 | * Set scroll position in CodeMirror editor view |
| 67 | */ |
| 68 | export function setScrollPosition( |
| 69 | view: EditorView, |
| 70 | scrollTop?: number, |
| 71 | scrollLeft?: number, |
| 72 | ): void { |
| 73 | const scroller = view.scrollDOM; |
| 74 | |
| 75 | if (typeof scrollTop === "number") { |
| 76 | scroller.scrollTop = scrollTop; |
| 77 | } |
| 78 | |
| 79 | if (typeof scrollLeft === "number") { |
| 80 | scroller.scrollLeft = scrollLeft; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Restore selection to editor view |
no outgoing calls
no test coverage detected