Fix anchor comparison in multi buffer after expanding excerpts (#28828)
Release Notes: - Fixed incorrect excerpt comparison when replacing them Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com> Co-authored-by: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
parent
b486e32f05
commit
41cffa64b0
2 changed files with 10 additions and 6 deletions
|
@ -61,11 +61,14 @@ impl Anchor {
|
|||
return Ordering::Equal;
|
||||
}
|
||||
|
||||
let excerpt_id_cmp = self.excerpt_id.cmp(&other.excerpt_id, snapshot);
|
||||
let self_excerpt_id = snapshot.latest_excerpt_id(self.excerpt_id);
|
||||
let other_excerpt_id = snapshot.latest_excerpt_id(other.excerpt_id);
|
||||
|
||||
let excerpt_id_cmp = self_excerpt_id.cmp(&other_excerpt_id, snapshot);
|
||||
if excerpt_id_cmp.is_ne() {
|
||||
return excerpt_id_cmp;
|
||||
}
|
||||
if self.excerpt_id == ExcerptId::min() || self.excerpt_id == ExcerptId::max() {
|
||||
if self_excerpt_id == ExcerptId::min() || self_excerpt_id == ExcerptId::max() {
|
||||
return Ordering::Equal;
|
||||
}
|
||||
if let Some(excerpt) = snapshot.excerpt(self.excerpt_id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue