aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/selection.rs
diff options
context:
space:
mode:
authorPascal Kuthe2023-11-21 00:46:12 +0000
committerBlaž Hrastnik2024-03-23 06:35:25 +0000
commitb46064b8c469c85b9626dba60728e23798354ed8 (patch)
tree203d9698a3e99767202c05e8c62850ea199a2a06 /helix-core/src/selection.rs
parent3001f22b315e479dcfc24c7a0fd221d7fb03d276 (diff)
Add an Amp-like jump command
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r--helix-core/src/selection.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs
index bd252deb..579499de 100644
--- a/helix-core/src/selection.rs
+++ b/helix-core/src/selection.rs
@@ -705,6 +705,15 @@ impl IntoIterator for Selection {
}
}
+impl From<Range> for Selection {
+ fn from(range: Range) -> Self {
+ Self {
+ ranges: smallvec![range],
+ primary_index: 0,
+ }
+ }
+}
+
// TODO: checkSelection -> check if valid for doc length && sorted
pub fn keep_or_remove_matches(