CodeMirrorEditor.mapPos method
CodeMirrorEditor › mapPos
Unofficial
Map a position taken before the changes made during the operation in progress onto where it sits after them.Signature:
mapPos(pos: EditorPosition, assoc?: number | undefined): EditorPositionParameters:
| Parameter | Type | Description |
|---|---|---|
| pos | EditorPosition | The position to map. |
| assoc? | number | undefined | Which side of an insertion at that exact position the mapped position ends up on. Defaults to 1, after the insertion. |
Returns: EditorPosition — The mapped position, or pos unchanged when no operation has made any changes.