diff --git a/crates/buffer/src/anchor.rs b/crates/buffer/src/anchor.rs index 4a420de21f..d978b76050 100644 --- a/crates/buffer/src/anchor.rs +++ b/crates/buffer/src/anchor.rs @@ -200,14 +200,14 @@ impl AnchorRangeSet { self.0.len() } - pub fn to_offset_ranges<'a>( + pub fn offset_ranges<'a>( &'a self, content: impl Into> + 'a, ) -> impl Iterator> + 'a { self.0.offset_ranges(content).map(|(range, _)| range) } - pub fn to_point_ranges<'a>( + pub fn point_ranges<'a>( &'a self, content: impl Into> + 'a, ) -> impl Iterator> + 'a { diff --git a/crates/editor/src/lib.rs b/crates/editor/src/lib.rs index 50f446c5e8..1030cab758 100644 --- a/crates/editor/src/lib.rs +++ b/crates/editor/src/lib.rs @@ -985,7 +985,7 @@ impl Editor { let buffer = self.buffer.read(cx); if old_selections .iter() - .zip(autoclose_pair_state.ranges.to_offset_ranges(buffer)) + .zip(autoclose_pair_state.ranges.offset_ranges(buffer)) .all(|(selection, autoclose_range)| { let autoclose_range_end = autoclose_range.end.to_offset(buffer); selection.is_empty() && selection.start == autoclose_range_end @@ -2327,7 +2327,7 @@ impl Editor { if selections.len() == autoclose_pair_state.ranges.len() { selections .iter() - .zip(autoclose_pair_state.ranges.to_point_ranges(buffer)) + .zip(autoclose_pair_state.ranges.point_ranges(buffer)) .all(|(selection, autoclose_range)| { let head = selection.head().to_point(&*buffer); autoclose_range.start <= head && autoclose_range.end >= head diff --git a/crates/language/src/lib.rs b/crates/language/src/lib.rs index 6142b506b5..c86fca62b4 100644 --- a/crates/language/src/lib.rs +++ b/crates/language/src/lib.rs @@ -585,7 +585,7 @@ impl Buffer { if let Some(inserted) = request.inserted.as_ref() { let inserted_row_ranges = contiguous_ranges( inserted - .to_point_ranges(&snapshot) + .point_ranges(&snapshot) .flat_map(|range| range.start.row..range.end.row + 1), max_rows_between_yields, );