mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 13:37:06 +04:00
Fix range.overlap()
This commit is contained in:
parent
5253f40477
commit
35b4fe4cd0
@ -59,11 +59,11 @@ pub fn is_empty(&self) -> bool {
|
||||
#[must_use]
|
||||
pub fn overlaps(&self, other: &Self) -> bool {
|
||||
// cursor overlap is checked differently
|
||||
if self.is_empty() {
|
||||
self.from() <= other.to()
|
||||
} else {
|
||||
self.from() < other.to()
|
||||
}
|
||||
// if self.is_empty() {
|
||||
// self.from() <= other.to()
|
||||
// } else {
|
||||
self.to() >= other.from() && other.to() >= self.from()
|
||||
// }
|
||||
}
|
||||
|
||||
pub fn contains(&self, pos: usize) -> bool {
|
||||
|
Loading…
Reference in New Issue
Block a user