Skip to content

Commit ce9e307

Browse files
committed
Don't strip trailing newlines but keep them in the diff.
This *should* work as we transform to a normalised form before diffing. However, I think the reason for the change ultimately was Windows, where crlf/lf differences might make diffs light up unnecessarily. Maybe there will be more polish in that regard. Unfortunately it's also not clear anymore why stripping was deemed so very necessary in the first place.
1 parent a6c6024 commit ce9e307

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/but-core/src/unified_diff.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ impl UnifiedDiff {
187187
Ok(())
188188
}
189189
}
190-
let input = prep.interned_input();
190+
let input = gix::diff::blob::intern::InternedInput::new(
191+
prep.old.intern_source(),
192+
prep.new.intern_source(),
193+
);
191194
let uni_diff = gix::diff::blob::UnifiedDiff::new(
192195
&input,
193196
ConsumeBinaryHunk::new(ProduceDiffHunk::default(), "\n"),

0 commit comments

Comments
 (0)