Skip to content

Type Editor


Type Editor / @type-editor/commands / util/move-selection-block / moveSelectionBlock

Function: moveSelectionBlock()

ts
function moveSelectionBlock(state, dir): Selection_2;

Defined in: util/move-selection-block.ts:13

Moves the selection to the next or previous block-level position.

Parameters

ParameterTypeDescription
statePmEditorStateThe current editor state
dirnumberDirection to move: -1 for backward, 1 for forward

Returns

Selection_2

A new selection at the block boundary, or null if not possible