Skip to main content

shift_runs_for_insert

Function shift_runs_for_insert 

Source
pub fn shift_runs_for_insert(
    runs: &mut [FormatRun],
    byte_offset: u32,
    inserted_bytes: u32,
)
Expand description

Apply an “insert inserted_bytes of text at byte_offset” mutation to a block’s runs in place. Runs strictly before the offset are unchanged; runs strictly after are shifted by +inserted_bytes; runs that straddle the offset are extended (the inserted text inherits the surrounding run’s format — Qt / ProseMirror convention).