ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: don't lose short runs of context lines in diffs

If the context was 3 lines or less, it would get lost before this
patch.
This commit is contained in:
Martin von Zweigbergk 2021-04-07 08:50:24 -07:00
parent d7395cc34a
commit e1ccdcffb7

View file

@ -697,7 +697,7 @@ fn print_diff(left: &[u8], right: &[u8], styler: &mut dyn Styler) {
}
}
} else {
if context_before {
if context_before || context.len() < num_context_lines {
for line in &context {
print_diff_line(styler, line);
}