Change multiline span ASCII art visual order

This commit is contained in:
Esteban Küber 2022-11-23 14:28:45 -08:00
parent 454784afba
commit ab04080b56
10 changed files with 111 additions and 105 deletions

View file

@ -2300,8 +2300,14 @@ impl FileWithAnnotatedLines {
}
let mut max_depth = 0; // max overlapping multiline spans
for (file, ann) in multiline_annotations {
for (_, ann) in &multiline_annotations {
max_depth = max(max_depth, ann.depth);
}
// Change order of multispan depth to minimize the number of overlaps in the ASCII art.
for (_, a) in multiline_annotations.iter_mut() {
a.depth = max_depth - a.depth + 1;
}
for (file, ann) in multiline_annotations {
let mut end_ann = ann.as_end();
if !ann.overlaps_exactly {
// avoid output like