diff --git a/core/src/text_buffer/mod.rs b/core/src/text_buffer/mod.rs index fc51899..f51feb5 100644 --- a/core/src/text_buffer/mod.rs +++ b/core/src/text_buffer/mod.rs @@ -2,6 +2,7 @@ use std::rc::Rc; mod rope; use rope::Rope; +pub use rope::{CharIterator, CharWithPointIterator}; pub struct TextBuffer { contents: Rc, @@ -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 {