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,10 +710,8 @@ fn print_diff(left: &[u8], right: &[u8], styler: &mut dyn Styler) -> io::Result<
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if context_before || context.len() < num_context_lines {
|
||||
for line in &context {
|
||||
print_diff_line(styler, line)?;
|
||||
}
|
||||
for line in &context {
|
||||
print_diff_line(styler, line)?;
|
||||
}
|
||||
context.clear();
|
||||
print_diff_line(styler, &diff_line)?;
|
||||
|
|
Loading…
Reference in a new issue