Skip to main content

block_document_position

Function block_document_position 

Source
pub fn block_document_position(block: &Block, store: &Store) -> i64
Expand description

Return the absolute character position of a block’s start in the document, derived from the rope via BlockOffsetIndex.

O(log n): one range_of_block lookup + one byte_to_char conversion. Falls back to block.document_position for blocks not registered in the index — currently table-cell blocks (plan §1.6 deferred) and blocks under non-top-level frames (insert_frame_uc only mirrors top-level frames). The stored field is set authoritatively by those non-flow paths and stays correct for them across main-flow edits.