mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 09:44:46 +03:00
Rename AnchorRangeSet::to_point_ranges -> point_ranges
This commit is contained in:
parent
9bc08e446b
commit
a1e576343e
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user