Skip to content
This page is available as Markdown at /api/selectors/variables/getpreviousblock.md. For the full documentation index, see /llms.txt, or the complete corpus at /llms-full.txt.

getPreviousBlock

const getPreviousBlock: EditorSelector<{ node: PortableTextBlock; path: BlockPath; } | undefined>

Defined in: selector.get-previous-block.ts:17

Returns the block before the selection’s start block within the same container scope, if any.

Siblings are resolved within the enclosing container (or the document root if the selection is at root level). Never crosses container boundaries.