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