Skip to content

Commit

Permalink
Clarify doc comment of merge_ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
hamrik committed May 19, 2023
1 parent 7ee7805 commit 4ce9daa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helix-core/src/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,14 @@ impl Selection {
self
}

// Replaces ranges with one spanning from leftmost to rightmost selection
/// Replaces ranges with one spanning from first to last range.
pub fn merge_ranges(self) -> Self {
let first = self.ranges.first().unwrap();
let last = self.ranges.last().unwrap();
Selection::new(smallvec![first.merge(*last)], 0)
}

// Merges all ranges that are consecutive
/// Merges all ranges that are consecutive.
pub fn merge_consecutive_ranges(mut self) -> Self {
let mut primary = self.ranges[self.primary_index];

Expand Down

0 comments on commit 4ce9daa

Please sign in to comment.