Skip to main content

rope_remove_block

Function rope_remove_block 

Source
pub fn rope_remove_block(store: &Store, block_id: EntityId)
Expand description

Remove a registered block from the rope: drops its content bytes plus one boundary \n (the one after, if the block has a successor; the one before, if it’s the last entry), removes the entry from the index, and shifts trailing entries by the negative byte delta.

No-op if block_id is not in the index. No-op for the special case of a single-block document being asked to remove its sole block (we’d produce an empty rope but the block itself is being cascaded by the caller).