Fix innermost brackets panic (#32120)
Release Notes: - Fixed a few rare panics that could happen when a multibuffer excerpt started with expanded deleted content.
This commit is contained in:
parent
7aa70a4858
commit
4b297a9967
2 changed files with 17 additions and 1 deletions
|
@ -2842,6 +2842,22 @@ async fn test_random_multibuffer(cx: &mut TestAppContext, mut rng: StdRng) {
|
|||
.unwrap()
|
||||
+ 1
|
||||
);
|
||||
let reference_ranges = cx.update(|cx| {
|
||||
reference
|
||||
.excerpts
|
||||
.iter()
|
||||
.map(|excerpt| {
|
||||
(
|
||||
excerpt.id,
|
||||
excerpt.range.to_offset(&excerpt.buffer.read(cx).snapshot()),
|
||||
)
|
||||
})
|
||||
.collect::<HashMap<_, _>>()
|
||||
});
|
||||
for i in 0..snapshot.len() {
|
||||
let excerpt = snapshot.excerpt_containing(i..i).unwrap();
|
||||
assert_eq!(excerpt.buffer_range(), reference_ranges[&excerpt.id()]);
|
||||
}
|
||||
|
||||
assert_consistent_line_numbers(&snapshot);
|
||||
assert_position_translation(&snapshot);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue