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

Function getSelection

src/cm/editorUtils.ts:49–55  ·  view source on GitHub ↗
(view: EditorView)

Source from the content-addressed store, hash-verified

47 * Get current selection from editor view
48 */
49export function getSelection(view: EditorView): SerializedSelection {
50 const sel = view.state.selection;
51 return {
52 ranges: sel.ranges.map((r) => ({ from: r.from, to: r.to })),
53 mainIndex: sel.mainIndex,
54 };
55}
56
57/**
58 * Get scroll position from editor view

Callers 1

saveState.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected