zenpatch 0.5.2

A robust library for applying text-based patches, designed for AI coding agents with backtracking algorithm
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Defines the `WhitespaceMode` enum for controlling patch matching sensitivity.
//!
//! This enum is used by the backtracking patcher to specify how strictly
//! whitespace should be handled when comparing lines.

/// Controls whitespace sensitivity when matching patch context and deletions.
#[derive(Clone, Copy, Debug)]
pub enum WhitespaceMode {
    /// Exact matching, preserving all whitespace (no normalization).
    Strict,
    /// Lenient matching: trims leading/trailing whitespace and collapses internal whitespace runs to single spaces before comparing.
    Lenient,
    /// SuperLenient matching: Lenient plus normalizes special characters like quotes and dashes.
    SuperLenient,
}