forked from mirrors/jj
diff: print context lines also when there are exactly 3 lines
My recent fix to print context lines when there are less than 3 lines of context wasn't enough; we should also print context lines when there are exactly 3 lines of context :) I can't understand what the `!context_before` condition was for, so I've just removed it. I guess I'll notice soon if things look worse in some case.
This commit is contained in:
parent
ca3949135c
commit
0844a2ec8c
1 changed files with 2 additions and 4 deletions
|
@ -710,11 +710,9 @@ fn print_diff(left: &[u8], right: &[u8], styler: &mut dyn Styler) -> io::Result<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if context_before || context.len() < num_context_lines {
|
|
||||||
for line in &context {
|
for line in &context {
|
||||||
print_diff_line(styler, line)?;
|
print_diff_line(styler, line)?;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
context.clear();
|
context.clear();
|
||||||
print_diff_line(styler, &diff_line)?;
|
print_diff_line(styler, &diff_line)?;
|
||||||
context_before = false;
|
context_before = false;
|
||||||
|
|
Loading…
Reference in a new issue