|
|
@ -59,11 +59,11 @@ impl Range {
|
|
|
|
#[must_use]
|
|
|
|
#[must_use]
|
|
|
|
pub fn overlaps(&self, other: &Self) -> bool {
|
|
|
|
pub fn overlaps(&self, other: &Self) -> bool {
|
|
|
|
// cursor overlap is checked differently
|
|
|
|
// cursor overlap is checked differently
|
|
|
|
if self.is_empty() {
|
|
|
|
// if self.is_empty() {
|
|
|
|
self.from() <= other.to()
|
|
|
|
// self.from() <= other.to()
|
|
|
|
} else {
|
|
|
|
// } else {
|
|
|
|
self.from() < other.to()
|
|
|
|
self.to() >= other.from() && other.to() >= self.from()
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn contains(&self, pos: usize) -> bool {
|
|
|
|
pub fn contains(&self, pos: usize) -> bool {
|
|
|
|