From 8b7c33d00daa13213de44ebab2c298fd35232412 Mon Sep 17 00:00:00 2001 From: Matt Armstrong Date: Sat, 6 Jul 2024 10:40:23 -0700 Subject: [PATCH] Minor improvements to comments in selection.rs (#11101) --- helix-core/src/selection.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs index 8995da8f9..eff1fcd70 100644 --- a/helix-core/src/selection.rs +++ b/helix-core/src/selection.rs @@ -175,7 +175,7 @@ pub fn contains(&self, pos: usize) -> bool { /// function runs in O(N) (N is number of changes) and can therefore /// cause performance problems if run for a large number of ranges as the /// complexity is then O(MN) (for multicuror M=N usually). Instead use - /// [Selection::map] or [ChangeSet::update_positions] instead + /// [Selection::map] or [ChangeSet::update_positions]. pub fn map(mut self, changes: &ChangeSet) -> Self { use std::cmp::Ordering; if changes.is_empty() { @@ -541,6 +541,8 @@ pub fn point(pos: usize) -> Self { } /// Normalizes a `Selection`. + /// + /// Ranges are sorted by [Range::from], with overlapping ranges merged. fn normalize(mut self) -> Self { if self.len() < 2 { return self;