on master help sign in
Fix range.overlap()
commit35b4fe4cd0a23310a3d71242e97ad6c1d081b7c2 authorBlaž Hrastnik <blaz@mxxn.io> dateSat 10 Apr 2021, 00:20 (6 years ago) parent5253f40
1 file changed+5−5
helix-core/src/selection.rs+5−5
helix-core/src/selection.rs+5−5
@@ -59,11 +59,11 @@ impl Range {
5959 #[must_use]
6060 pub fn overlaps(&self, other: &Self) -> bool {
6161 // cursor overlap is checked differently
62− if self.is_empty() {
63− self.from() <= other.to()
64− } else {
65− self.from() < other.to()
66− }
62+ // if self.is_empty() {
63+ // self.from() <= other.to()
64+ // } else {
65+ self.to() >= other.from() && other.to() >= self.from()
66+ // }
6767 }
6868
6969 pub fn contains(&self, pos: usize) -> bool {