Fix typo in Excerpt::contains
(#36621)
Follow-up to #36524 Release Notes: - N/A
This commit is contained in:
parent
8e57f633d0
commit
00ff7b72d7
1 changed files with 13 additions and 14 deletions
|
@ -6998,20 +6998,19 @@ impl Excerpt {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn contains(&self, anchor: &Anchor) -> bool {
|
fn contains(&self, anchor: &Anchor) -> bool {
|
||||||
anchor.buffer_id == None
|
(anchor.buffer_id == None || anchor.buffer_id == Some(self.buffer_id))
|
||||||
|| anchor.buffer_id == Some(self.buffer_id)
|
&& self
|
||||||
&& self
|
.range
|
||||||
.range
|
.context
|
||||||
.context
|
.start
|
||||||
.start
|
.cmp(&anchor.text_anchor, &self.buffer)
|
||||||
.cmp(&anchor.text_anchor, &self.buffer)
|
.is_le()
|
||||||
.is_le()
|
&& self
|
||||||
&& self
|
.range
|
||||||
.range
|
.context
|
||||||
.context
|
.end
|
||||||
.end
|
.cmp(&anchor.text_anchor, &self.buffer)
|
||||||
.cmp(&anchor.text_anchor, &self.buffer)
|
.is_ge()
|
||||||
.is_ge()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The [`Excerpt`]'s start offset in its [`Buffer`]
|
/// The [`Excerpt`]'s start offset in its [`Buffer`]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue