MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / setScrollPosition

Function setScrollPosition

src/cm/editorUtils.ts:68–82  ·  view source on GitHub ↗
(
	view: EditorView,
	scrollTop?: number,
	scrollLeft?: number,
)

Source from the content-addressed store, hash-verified

66 * Set scroll position in CodeMirror editor view
67 */
68export 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

Callers 2

editorFile.jsFile · 0.90
applyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected