mirror of https://github.com/helix-editor/helix
Fix range.overlap()
parent
5253f40477
commit
35b4fe4cd0
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue