Skip to main content

apply_search_replace_blocks

Function apply_search_replace_blocks 

Source
pub fn apply_search_replace_blocks(
    blocks: &[SearchReplaceBlock],
    cwd: &Path,
    opts: &ApplySearchReplaceOptions,
    mode: ApplyMode,
    guard: Option<&PathGuard>,
) -> Result<Vec<EditResult>>
Expand description

Apply parsed SEARCH/REPLACE blocks under cwd.

Default: multi-match is crate::fallback::EditErrorKind::AmbiguousTarget and nothing is written. replace_all: true updates every exact match. Empty SEARCH is invalid input. Relative paths only (or absolute when a PathGuard allows the contained path). .. is rejected.