Rename AnchorRangeSet::to_point_ranges -> point_ranges

This commit is contained in:
Max Brunsfeld 2021-10-28 16:32:49 -07:00
parent 9bc08e446b
commit a1e576343e
3 changed files with 5 additions and 5 deletions

View File

@ -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<Content<'a>> + 'a,
) -> impl Iterator<Item = Range<usize>> + '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<Content<'a>> + 'a,
) -> impl Iterator<Item = Range<Point>> + 'a {

View File

@ -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

View File

@ -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,
);