diff --git a/CHANGELOG.md b/CHANGELOG.md index ad9bc8ba8..703631d8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## 0.34 (unreleased) +### Display + +Fixed an issue where side-by-side display would sometimes print the +line number from the second file rather than the first file. + ## 0.33 (released 21st August 2022) ### Diffing diff --git a/sample_files/compare.expected b/sample_files/compare.expected index 3dd32a55a..5a9fbe0d2 100644 --- a/sample_files/compare.expected +++ b/sample_files/compare.expected @@ -137,7 +137,7 @@ sample_files/preprocesor_before.h sample_files/preprocesor_after.h 3e4331cb935cbe735a79ebc43786cd3a - sample_files/ruby_before.rb sample_files/ruby_after.rb -4a9847a91e32ec6afdc2f0b01e28d2d6 - +d88046b43f826a34bbd4a7b9d6bb704d - sample_files/scala_before.scala sample_files/scala_after.scala bb18213033492a633e7f978ab9711ae1 - diff --git a/src/display/side_by_side.rs b/src/display/side_by_side.rs index 31a890a19..0a6c6bdae 100644 --- a/src/display/side_by_side.rs +++ b/src/display/side_by_side.rs @@ -460,7 +460,7 @@ pub fn print( // We didn't have any changed RHS lines in the // hunk, but we had some contextual lines that // only occurred on the LHS (e.g. extra newlines). - println!("{}{}", display_rhs_line_num, display_rhs_line_num); + println!("{}{}", display_lhs_line_num, display_rhs_line_num); } } } else if no_rhs_changes && !show_both {