From b46064b8c469c85b9626dba60728e23798354ed8 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Tue, 21 Nov 2023 01:46:12 +0100 Subject: Add an Amp-like jump command Co-authored-by: Michael Davis --- helix-core/src/selection.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'helix-core') 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 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( -- cgit v1.2.3-70-g09d2