Inital Commit

This commit is contained in:
2026-01-11 01:15:35 -06:00
commit ade1e41d1b
7 changed files with 18022 additions and 0 deletions

33
src/ropeintegration.rs Normal file
View File

@@ -0,0 +1,33 @@
use eframe::egui::{self, scroll_area::State};
use ropey;
#[derive(Default)]
pub struct ERopey {
pub rope: ropey::Rope,
viewbuffer: String,
}
impl egui::widgets::TextBuffer for ERopey {
fn is_mutable(&self) -> bool {
true
}
fn as_str(&self) -> &str {
self.rope.slice(..).as_str().unwrap()
}
fn insert_text(&mut self, text: &str, char_index: usize) -> usize {
let first = self.rope.len_chars();
self.rope.insert(char_index, text);
let second = self.rope.len_chars();
second-first
}
fn delete_char_range(&mut self, char_range: std::ops::Range<usize>) {
self.rope.remove(char_range);
}
fn type_id(&self) -> std::any::TypeId {
std::any::TypeId::of::<Self>()
}
}