MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / compute_inline_diff

Function compute_inline_diff

atomic-core/src/diff/inline.rs:601–603  ·  view source on GitHub ↗

Compute an inline diff between two lines. This is the main entry point for inline diff computation. It tokenizes both lines, computes a word-level diff, and converts the results to byte-range hunks suitable for highlighting. # Arguments `old_line` - The original line content `new_line` - The modified line content # Returns An `InlineDiff` containing highlighted hunks for both lines. # Exampl

(old_line: &'a [u8], new_line: &'a [u8])

Source from the content-addressed store, hash-verified

599/// assert!(diff.inserted_bytes() > 0);
600/// ```
601pub fn compute_inline_diff<'a>(old_line: &'a [u8], new_line: &'a [u8]) -> InlineDiff<'a> {
602 compute_inline_diff_with_config(old_line, new_line, &WordDiffConfig::default())
603}
604
605/// Compute an inline diff with custom configuration.
606///

Calls 1