Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix typo in `Excerpt::contains` (#36621)

Cole Miller739e4551da85
diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rs
index f73014a6ff1..a54d38163da 100644
--- a/crates/multi_buffer/src/multi_buffer.rs
+++ b/crates/multi_buffer/src/multi_buffer.rs
@@ -6998,20 +6998,19 @@ impl Excerpt {
}
fn contains(&self, anchor: &Anchor) -> bool {
- anchor.buffer_id == None
- || anchor.buffer_id == Some(self.buffer_id)
- && self
- .range
- .context
- .start
- .cmp(&anchor.text_anchor, &self.buffer)
- .is_le()
- && self
- .range
- .context
- .end
- .cmp(&anchor.text_anchor, &self.buffer)
- .is_ge()
+ (anchor.buffer_id == None || anchor.buffer_id == Some(self.buffer_id))
+ && self
+ .range
+ .context
+ .start
+ .cmp(&anchor.text_anchor, &self.buffer)
+ .is_le()
+ && self
+ .range
+ .context
+ .end
+ .cmp(&anchor.text_anchor, &self.buffer)
+ .is_ge()
}
/// The [`Excerpt`]'s start offset in its [`Buffer`]