Skip to content

CodeMirrorEditor.moveByChar method

CodeMirrorEditor › moveByChar

Unofficial

Move a position by character in the given direction.

Signature:

moveByChar(pos: EditorPosition, dir: "left" | "right", unit: number): EditorPosition

Parameters:

ParameterTypeDescription
posEditorPositionThe starting position.
dir"left" | "right"The direction to move.
unitnumberThe number of characters to move.

Returns: EditorPositionThe resulting editor position.