Skip to main content

intraline

Function intraline 

Source
pub fn intraline(old: &str, new: &str) -> (Vec<Range<usize>>, Vec<Range<usize>>)
Expand description

(old_emphasis, new_emphasis) byte ranges, near-adjacent runs merged.

We diff UAX #29 word tokens so unrelated tokens never share a stray letter (npm → bun is a whole-token swap).

use diffler_core::diff::intraline;

let (old, new) = intraline("if x < y:", "if x <= y:");
assert!(old.is_empty());
assert_eq!(new, vec![6..7]);