aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/selection.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r--helix-core/src/selection.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs
index 6ca798a6..64ff51d8 100644
--- a/helix-core/src/selection.rs
+++ b/helix-core/src/selection.rs
@@ -216,6 +216,16 @@ impl Range {
}
}
+impl From<(usize, usize)> for Range {
+ fn from(tuple: (usize, usize)) -> Self {
+ Self {
+ anchor: tuple.0,
+ head: tuple.1,
+ horiz: None,
+ }
+ }
+}
+
/// A selection consists of one or more selection ranges.
/// invariant: A selection can never be empty (always contains at least primary range).
#[derive(Debug, Clone, PartialEq, Eq)]