Skip to main content

shift_folds_after_edit

Function shift_folds_after_edit 

Source
pub fn shift_folds_after_edit(
    folds: &mut Vec<Fold>,
    edit_start: usize,
    drop_end: usize,
    shift_threshold: usize,
    delta: isize,
)
Expand description

Shift every fold in folds by an edit’s row-delta band, in place. Folds the edit’s deleted band fully consumes are dropped (mirrors invalidate_folds for the folds that DO survive but move).

Shared by crate::View::rebase_folds (engine-side, the buffer’s own fold storage) and the app’s sibling-window fold snapshot shift, so both converge on the identical row-shift rule.