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:

Parameter Type Description
pos EditorPosition The starting position.
dir "left" | "right" The direction to move.
unit number The number of characters to move.

Returns: EditorPositionThe resulting editor position.