Skip to main content

map_position

Function map_position 

Source
pub fn map_position(
    position: usize,
    start: usize,
    old_end: usize,
    new_end: usize,
) -> usize
Expand description

One anchor through one edit. Callers guarantee no overflow: positions are byte offsets bounded by the buffer length, and new_end is the post-edit end of the replaced range (start + replacement length).