mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 13:24:19 +00:00
Fix handling of excerpts surrounded by edits in MultiBuffer::edit
This commit is contained in:
parent
4bea16eb31
commit
2930ea8fb0
1 changed files with 2 additions and 5 deletions
|
@ -352,13 +352,10 @@ impl MultiBuffer {
|
|||
if excerpt.id == end_excerpt.id {
|
||||
break;
|
||||
}
|
||||
|
||||
let excerpt_range = start_excerpt.range.end.to_offset(&start_excerpt.buffer)
|
||||
..start_excerpt.range.end.to_offset(&start_excerpt.buffer);
|
||||
buffer_edits
|
||||
.entry(excerpt.buffer_id)
|
||||
.or_insert(Vec::new())
|
||||
.push((excerpt_range, false));
|
||||
.push((excerpt.range.to_offset(&excerpt.buffer), false));
|
||||
cursor.next(&());
|
||||
}
|
||||
}
|
||||
|
@ -386,7 +383,7 @@ impl MultiBuffer {
|
|||
insertions.push(
|
||||
buffer.anchor_before(range.start)..buffer.anchor_before(range.end),
|
||||
);
|
||||
} else {
|
||||
} else if !range.is_empty() {
|
||||
deletions.push(
|
||||
buffer.anchor_before(range.start)..buffer.anchor_before(range.end),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue