Fix *Map randomized tests (#64527)

Closes https://github.com/zed-industries/zed/issues/64444

Ensures that with `ITERATIONS=200000 OPERATIONS=30`, each of the
following tests pass: `test_random_inlays`, `test_random_folds`,
`test_random_tabs`, `test_random_wraps`, `test_random_display_map`,
`test_random_blocks`, and 12/14 shards of the diff test.

Each comment contains the bug and the fix explanation.

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov
2026-09-23 16:13:31 +00:00
committed by GitHub
parent 9183ba4c55
commit eb2f43d982
6 changed files with 156 additions and 37 deletions
+1 -1
View File
@@ -4958,7 +4958,7 @@ impl MultiBufferSnapshot {
base_text_byte_range.start..base_text_offset,
);
position.0.add_text_dim(&position_in_hunk);
} else if at_transform_end {
} else if at_transform_end && base_text_offset > base_text_byte_range.end {
// diff_base offset falls outside this hunk's range;
// advance to see if the next transform is a better fit.
diff_transforms.next();