mirror of https://github.com/Wilfred/difftastic/
Always display all lines in a hunk
Previously we were assuming that the first/last line pairs in a hunk contained the earliest/latest lines on both sides. This isn't true when there are no common items between the lines. This fixes some display issues in load_before/after.js, but include a new integration test that is smaller and easier to eyeball. Fixes #133pull/166/head
parent
6d9dc8322f
commit
b2229d66a8
@ -0,0 +1,14 @@
|
||||
fn print_diff_result() {
|
||||
match () {
|
||||
x => {
|
||||
let opposite_to_lhs = opposite_positions(&summary.lhs_positions);
|
||||
|
||||
let hunks = merge_adjacent(
|
||||
hunks,
|
||||
opposite_to_lhs,
|
||||
);
|
||||
|
||||
let lang_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
fn print_diff_result() {
|
||||
if summary {
|
||||
if print_unchanged {
|
||||
}
|
||||
}
|
||||
|
||||
let opposite_to_lhs = opposite_positions(&summary.lhs_positions);
|
||||
|
||||
let hunks = merge_adjacent(
|
||||
hunks,
|
||||
opposite_to_lhs,
|
||||
);
|
||||
|
||||
let lang_name;
|
||||
}
|
||||
Loading…
Reference in New Issue