From 62eb8c6b407c61d21dbee83c4b4e78c4e6cb87c3 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 30 Jul 2021 16:50:38 +0900 Subject: mouse: Remove verify_screen_coords, refactor primary selection modification --- helix-core/src/selection.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'helix-core/src') 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 { -- cgit v1.2.3-70-g09d2