Editor: make delete_range and insert_at methods public

This commit is contained in:
Jeremy Soller 2023-12-05 10:04:50 -07:00
parent afc5b525f1
commit de6f2c7fbe
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
4 changed files with 93 additions and 81 deletions

View file

@ -294,6 +294,14 @@ impl<'a> Edit for ViEditor<'a> {
self.editor.shape_as_needed(font_system);
}
fn delete_range(&mut self, start: Cursor, end: Cursor) {
self.editor.delete_range(start, end);
}
fn insert_at(&mut self, cursor: Cursor, data: &str, attrs_list: Option<AttrsList>) -> Cursor {
self.editor.insert_at(cursor, data, attrs_list)
}
fn copy_selection(&self) -> Option<String> {
self.editor.copy_selection()
}
@ -302,10 +310,6 @@ impl<'a> Edit for ViEditor<'a> {
self.editor.delete_selection()
}
fn insert_string(&mut self, data: &str, attrs_list: Option<AttrsList>) {
self.editor.insert_string(data, attrs_list);
}
fn apply_change(&mut self, change: &Change) -> bool {
self.editor.apply_change(change)
}