diff options
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r-- | helix-core/src/selection.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs index 13c820f1..9413fead 100644 --- a/helix-core/src/selection.rs +++ b/helix-core/src/selection.rs @@ -179,6 +179,11 @@ impl Selection { } } + /// Constructs a selection holding a single cursor. + pub fn point(pos: usize) -> Self { + Self::single(pos, pos) + } + #[must_use] pub fn new(ranges: SmallVec<[Range; 1]>, primary_index: usize) -> Self { fn normalize(mut ranges: SmallVec<[Range; 1]>, mut primary_index: usize) -> Selection { |