Contiguous novel atoms are always better than changing depth of novel lists

ida_star
Wilfred Hughes 2021-07-31 23:31:29 +07:00
parent 04c37b3865
commit 2e6666041f
2 changed files with 11 additions and 2 deletions

@ -12,6 +12,9 @@ Difftastic will now prefer matching up comments that are similar
Contiguous syntax logic now considers close delimiter positions, so
`[ \n ];` now treats the `;` atom as contiguous.
Fixed an issue where diffs would prefer prefer a low depth change on a
delimiter over a delimiter that gave contiguous changes.
### Display
Display width calculations are now based on the longest line visible

@ -156,14 +156,20 @@ impl Edge {
if *contiguous {
300
} else {
301
// This needs to be more than 40 greater than the
// contiguous case. Otherwise, we end up choosing
// a badly positioned unchanged elimiter just
// because it has a better depth difference.
//
// TODO: write a test for this case.
350
}
}
NovelDelimiterLHS { contiguous } | NovelDelimiterRHS { contiguous } => {
if *contiguous {
300
} else {
301
350
}
}