Skip to content

Editor.posToOffset method

Editor › posToOffset

Official

Convert a position to an offset.

Signature:

posToOffset(pos: EditorPosition): number

Parameters:

Parameter Type Description
pos EditorPosition The position to convert.

Returns: numberThe offset.

Since: 0.11.11

Example:

console.log(editor.posToOffset({ line: 12, ch: 3 }));