diff options
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r-- | helix-core/src/selection.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs index 14c54295..a3ea2ed4 100644 --- a/helix-core/src/selection.rs +++ b/helix-core/src/selection.rs @@ -329,11 +329,18 @@ pub struct Selection { impl Selection { // eq + #[inline] #[must_use] pub fn primary(&self) -> Range { self.ranges[self.primary_index] } + #[inline] + #[must_use] + pub fn primary_mut(&mut self) -> &mut Range { + &mut self.ranges[self.primary_index] + } + /// Ensure selection containing only the primary selection. pub fn into_single(self) -> Self { if self.ranges.len() == 1 { |