Editor.posToOffset method
Editor › posToOffset
Official
Convert a position to an offset.Signature:
posToOffset(pos: EditorPosition): numberParameters:
| Parameter | Type | Description |
|---|---|---|
| pos | EditorPosition | The position to convert. |
Returns: number — The offset.
Since: 0.11.11
Example:
console.log(editor.posToOffset({ line: 12, ch: 3 }));