Enable external change tracking

This commit is contained in:
Jeremy Soller 2023-11-13 12:37:07 -07:00
parent e942e649ed
commit 7830f4107c
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
4 changed files with 253 additions and 209 deletions

View file

@ -4,7 +4,7 @@ use modit::{Event, Key, Motion, Parser, TextObject, WordIter};
use unicode_segmentation::UnicodeSegmentation;
use crate::{
Action, AttrsList, BorrowedWithFontSystem, Buffer, Color, Cursor, Edit, FontSystem,
Action, AttrsList, BorrowedWithFontSystem, Buffer, Change, Color, Cursor, Edit, FontSystem,
SyntaxEditor, SyntaxTheme,
};
@ -230,6 +230,14 @@ impl<'a> Edit for ViEditor<'a> {
self.editor.insert_string(data, attrs_list);
}
fn start_change(&mut self) {
self.editor.start_change();
}
fn finish_change(&mut self) -> Option<Change> {
self.editor.finish_change()
}
fn action(&mut self, font_system: &mut FontSystem, action: Action) {
let editor = &mut self.editor;
log::info!("Action {:?}", action);