@jsvision/code-editor / offsetToPosition
Function: offsetToPosition()
offsetToPosition(
snapshot,offset):DocumentPosition
Defined in: code-editor/src/document/positions.ts:30
Converts a UTF-16 document offset to a zero-based line and character.
Parameters
snapshot
offset
number
Returns
Example
ts
const position = offsetToPosition(snapshot, 4);