Commit 11b3577
committed
fix: display panic where lines could appear in multiple output rows
Remove the slicing optimization in side_by_side.rs that assumed hunks appear in
matched_lines order. It seems the rationale "We iterate through hunks in order,
so we know the next hunk must appear after start_i" doesn't hold (maybe because
something changed since this optimization landed?). When there are interleaved
LHS-only and RHS-only novel sections, hunks from matched_novel_lines may not be
strictly ordered by their position in matched_lines.
Fixes Wilfred#770 where the slicing would remove lines that later hunks still needed
to display, leading to a panic.1 parent e55f7b6 commit 11b3577
1 file changed
+6
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | | - | |
| 548 | + | |
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
621 | 620 | | |
622 | 621 | | |
623 | 622 | | |
| |||
0 commit comments