Expose some Rope functions through TextBuffer

This is mostly just to silence unused code warnings for now.
This commit is contained in:
Matthew Gordon 2025-10-30 21:48:10 -03:00
parent 0ae501d150
commit 529ac555ec
1 changed files with 13 additions and 0 deletions

View File

@ -2,6 +2,7 @@ use std::rc::Rc;
mod rope;
use rope::Rope;
pub use rope::{CharIterator, CharWithPointIterator};
pub struct TextBuffer {
contents: Rc<Rope>,
@ -53,6 +54,18 @@ impl TextBuffer {
}
}
}
pub fn delete_at_char_index(&mut self, start: usize, length: usize) {
self.contents = self.contents.delete_at_char_index(start, length)
}
pub fn iter_chars(&self) -> CharIterator {
self.contents.iter_chars()
}
pub fn iter_chars_with_point(&self) -> CharWithPointIterator {
self.contents.iter_chars_with_point()
}
}
impl Default for TextBuffer {