diff options
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r-- | helix-core/src/selection.rs | 9 |
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( |