From 529ac555eca1b6d66d333098cb8cdf9dbb903933 Mon Sep 17 00:00:00 2001 From: Matthew Gordon Date: Thu, 30 Oct 2025 21:48:10 -0300 Subject: [PATCH] Expose some Rope functions through TextBuffer This is mostly just to silence unused code warnings for now. --- core/src/text_buffer/mod.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 {