MCPcopy Create free account
hub / github.com/editablejs/editable / toYPos

Method toYPos

packages/plugins/codeblock/src/plugin/yjs/sync.ts:47–49  ·  view source on GitHub ↗

* Helper function to transform an absolute index position to a Yjs-based relative position * (https://docs.yjs.dev/api/relative-positions). * * A relative position can be transformed back to an absolute position even after the document has changed. The position is * automatically adapted

(pos: number, assoc = 0)

Source from the content-addressed store, hash-verified

45 * @param [assoc]
46 */
47 toYPos(pos: number, assoc = 0) {
48 return Y.createRelativePositionFromTypeIndex(this.ytext, pos, assoc)
49 }
50
51 /**
52 * @param rpos

Callers 1

toYRangeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected