mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 13:24:19 +00:00
Add Rope::chunks
This commit is contained in:
parent
6e30fdbf5c
commit
e2c19d3d3f
1 changed files with 4 additions and 0 deletions
|
@ -138,6 +138,10 @@ impl Rope {
|
|||
Chars::new(self, start)
|
||||
}
|
||||
|
||||
pub fn chunks<'a>(&'a self) -> impl Iterator<Item = &'a str> {
|
||||
self.chunks.cursor::<(), ()>().map(|c| c.0.as_str())
|
||||
}
|
||||
|
||||
fn text(&self) -> String {
|
||||
let mut text = String::new();
|
||||
for chunk in self.chunks.cursor::<(), ()>() {
|
||||
|
|
Loading…
Reference in a new issue