Clear path-based excerpt data properly (#28026)
Follow-up of https://github.com/zed-industries/zed/pull/27893 Release Notes: - N/A Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
e5e3e9ac8c
commit
c674e8d62d
1 changed files with 4 additions and 3 deletions
|
@ -1719,9 +1719,7 @@ impl MultiBuffer {
|
||||||
(None, Some(_)) => {
|
(None, Some(_)) => {
|
||||||
let existing_id = existing_iter.next().unwrap();
|
let existing_id = existing_iter.next().unwrap();
|
||||||
let locator = snapshot.excerpt_locator_for_id(existing_id);
|
let locator = snapshot.excerpt_locator_for_id(existing_id);
|
||||||
let Some(existing_excerpt) = excerpts_cursor.item() else {
|
let existing_excerpt = excerpts_cursor.item().unwrap();
|
||||||
break;
|
|
||||||
};
|
|
||||||
excerpts_cursor.seek_forward(&Some(locator), Bias::Left, &());
|
excerpts_cursor.seek_forward(&Some(locator), Bias::Left, &());
|
||||||
let existing_end = existing_excerpt
|
let existing_end = existing_excerpt
|
||||||
.range
|
.range
|
||||||
|
@ -1993,6 +1991,8 @@ impl MultiBuffer {
|
||||||
self.sync(cx);
|
self.sync(cx);
|
||||||
let ids = self.excerpt_ids();
|
let ids = self.excerpt_ids();
|
||||||
self.buffers.borrow_mut().clear();
|
self.buffers.borrow_mut().clear();
|
||||||
|
self.excerpts_by_path.clear();
|
||||||
|
self.paths_by_excerpt.clear();
|
||||||
let mut snapshot = self.snapshot.borrow_mut();
|
let mut snapshot = self.snapshot.borrow_mut();
|
||||||
let start = ExcerptOffset::new(0);
|
let start = ExcerptOffset::new(0);
|
||||||
let prev_len = ExcerptOffset::new(snapshot.excerpts.summary().text.len);
|
let prev_len = ExcerptOffset::new(snapshot.excerpts.summary().text.len);
|
||||||
|
@ -2001,6 +2001,7 @@ impl MultiBuffer {
|
||||||
snapshot.is_dirty = false;
|
snapshot.is_dirty = false;
|
||||||
snapshot.has_deleted_file = false;
|
snapshot.has_deleted_file = false;
|
||||||
snapshot.has_conflict = false;
|
snapshot.has_conflict = false;
|
||||||
|
snapshot.replaced_excerpts.clear();
|
||||||
|
|
||||||
self.sync_diff_transforms(
|
self.sync_diff_transforms(
|
||||||
&mut snapshot,
|
&mut snapshot,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue