Always sync
before clearing or removing excerpts from MultiBuffer
We don't have any test that proves this is needed but seems good nonetheless.
This commit is contained in:
parent
ff0fa0e0bd
commit
2611b5449f
1 changed files with 2 additions and 0 deletions
|
@ -772,6 +772,7 @@ impl MultiBuffer {
|
|||
}
|
||||
|
||||
pub fn clear(&mut self, cx: &mut ModelContext<Self>) {
|
||||
self.sync(cx);
|
||||
self.buffers.borrow_mut().clear();
|
||||
let mut snapshot = self.snapshot.borrow_mut();
|
||||
let prev_len = snapshot.len();
|
||||
|
@ -853,6 +854,7 @@ impl MultiBuffer {
|
|||
excerpt_ids: impl IntoIterator<Item = &'a ExcerptId>,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) {
|
||||
self.sync(cx);
|
||||
let mut buffers = self.buffers.borrow_mut();
|
||||
let mut snapshot = self.snapshot.borrow_mut();
|
||||
let mut new_excerpts = SumTree::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue