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

Function lineColToOffset

src/cm/editorUtils.ts:122–129  ·  view source on GitHub ↗
(
		doc: EditorState["doc"],
		line: number,
		col: number,
	)

Source from the content-addressed store, hash-verified

120 if (!Array.isArray(folds) || folds.length === 0) return;
121
122 function lineColToOffset(
123 doc: EditorState["doc"],
124 line: number,
125 col: number,
126 ): number {
127 const ln = doc.line(line);
128 return Math.min(ln.from + col, ln.to);
129 }
130
131 function loadFolds(
132 state: EditorState,

Callers 1

loadFoldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected