mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-02 08:20:09 +00:00
Rename rope::ChunksIter
to rope::Chunks
This is consistent with how we name the other chunk iterators.
This commit is contained in:
parent
6e791edb18
commit
4ada5e0666
3 changed files with 10 additions and 10 deletions
|
@ -6,7 +6,7 @@ mod selection;
|
|||
pub use anchor::*;
|
||||
use parking_lot::Mutex;
|
||||
pub use point::*;
|
||||
pub use rope::{ChunksIter, Rope, TextSummary};
|
||||
pub use rope::{Chunks, Rope, TextSummary};
|
||||
use seahash::SeaHasher;
|
||||
pub use selection::*;
|
||||
use similar::{ChangeTag, TextDiff};
|
||||
|
@ -746,7 +746,7 @@ impl Buffer {
|
|||
self.text_for_range(0..self.len()).collect()
|
||||
}
|
||||
|
||||
pub fn text_for_range<'a, T: ToOffset>(&'a self, range: Range<T>) -> ChunksIter<'a> {
|
||||
pub fn text_for_range<'a, T: ToOffset>(&'a self, range: Range<T>) -> Chunks<'a> {
|
||||
let start = range.start.to_offset(self);
|
||||
let end = range.end.to_offset(self);
|
||||
self.visible_text.chunks_in_range(start..end)
|
||||
|
@ -2178,7 +2178,7 @@ impl<'a, F: Fn(&FragmentSummary) -> bool> Iterator for Edits<'a, F> {
|
|||
}
|
||||
|
||||
pub struct HighlightedChunksIter<'a, T: tree_sitter::TextProvider<'a>> {
|
||||
chunks: ChunksIter<'a>,
|
||||
chunks: Chunks<'a>,
|
||||
captures: iter::Peekable<tree_sitter::QueryCaptures<'a, 'a, T>>,
|
||||
stack: Vec<(usize, usize)>,
|
||||
offset: usize,
|
||||
|
|
|
@ -118,12 +118,12 @@ impl Rope {
|
|||
self.chunks_in_range(start..self.len()).flat_map(str::chars)
|
||||
}
|
||||
|
||||
pub fn chunks<'a>(&'a self) -> ChunksIter<'a> {
|
||||
pub fn chunks<'a>(&'a self) -> Chunks<'a> {
|
||||
self.chunks_in_range(0..self.len())
|
||||
}
|
||||
|
||||
pub fn chunks_in_range<'a>(&'a self, range: Range<usize>) -> ChunksIter<'a> {
|
||||
ChunksIter::new(self, range)
|
||||
pub fn chunks_in_range<'a>(&'a self, range: Range<usize>) -> Chunks<'a> {
|
||||
Chunks::new(self, range)
|
||||
}
|
||||
|
||||
pub fn to_point(&self, offset: usize) -> Point {
|
||||
|
@ -268,12 +268,12 @@ impl<'a> Cursor<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct ChunksIter<'a> {
|
||||
pub struct Chunks<'a> {
|
||||
chunks: sum_tree::Cursor<'a, Chunk, usize, usize>,
|
||||
range: Range<usize>,
|
||||
}
|
||||
|
||||
impl<'a> ChunksIter<'a> {
|
||||
impl<'a> Chunks<'a> {
|
||||
pub fn new(rope: &'a Rope, range: Range<usize>) -> Self {
|
||||
let mut chunks = rope.chunks.cursor();
|
||||
chunks.seek(&range.start, SeekBias::Right, &());
|
||||
|
@ -306,7 +306,7 @@ impl<'a> ChunksIter<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Iterator for ChunksIter<'a> {
|
||||
impl<'a> Iterator for Chunks<'a> {
|
||||
type Item = &'a str;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
|
|
|
@ -669,7 +669,7 @@ impl<'a> Iterator for BufferRows<'a> {
|
|||
|
||||
pub struct Chunks<'a> {
|
||||
transform_cursor: Cursor<'a, Transform, DisplayOffset, TransformSummary>,
|
||||
buffer_chunks: buffer::ChunksIter<'a>,
|
||||
buffer_chunks: buffer::Chunks<'a>,
|
||||
buffer_offset: usize,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue