Also consider matched lines when calculating which lines to show after

After merging hunks, we may have lines on the opposite side.
pull/70/head
Wilfred Hughes 2021-11-18 23:02:10 +07:00
parent f675ce3ecc
commit 90122a6d3c
1 changed files with 4 additions and 4 deletions

@ -216,9 +216,9 @@ pub fn calculate_context(
Some(first_line) => match *first_line {
(Some(lhs_line), _) => {
let mut max_opposite = None;
for (_, rhs_line) in &before_lines {
for (_, rhs_line) in [&before_lines, lines].concat() {
if let Some(rhs_line) = rhs_line {
max_opposite = Some(*rhs_line);
max_opposite = Some(rhs_line);
}
}
@ -232,9 +232,9 @@ pub fn calculate_context(
}
(_, Some(rhs_line)) => {
let mut max_opposite = None;
for (lhs_line, _) in &before_lines {
for (lhs_line, _) in [&before_lines, lines].concat() {
if let Some(lhs_line) = lhs_line {
max_opposite = Some(*lhs_line);
max_opposite = Some(lhs_line);
}
}