Skip to content

Type Editor


Type Editor / @type-editor/commands / util/helpers / atBlockEnd

Function: atBlockEnd()

ts
function atBlockEnd(state, view?): ResolvedPos;

Defined in: util/helpers.ts:66

Checks if the cursor is at the end of a textblock.

This function determines whether the selection is a cursor positioned at the very end of a textblock. It uses the view (if provided) for accurate bidirectional text detection, which is important for languages with right-to-left text direction.

Parameters

ParameterTypeDescription
statePmEditorStateThe current editor state
view?PmEditorViewOptional editor view for bidirectional text detection

Returns

ResolvedPos

The cursor position if at block end, null otherwise