Skip to main content

suffix_replace

Function suffix_replace 

Source
pub fn suffix_replace(old: &str, new: &str) -> Option<LineSuffixReplace>
Expand description

The minimal line-granular replacement turning old into new: the index of the first differing line, and the replacement text for everything from that line onward. None when the texts are already equal.

Pure and unit-testable; the mode turns this into an Edit against the live buffer positions.