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

@ -8,8 +8,8 @@ use syntect::highlighting::{
use syntect::parsing::{ParseState, ScopeStack, SyntaxReference, SyntaxSet};
use crate::{
Action, AttrsList, BorrowedWithFontSystem, Buffer, Color, Cursor, Edit, Editor, FontSystem,
Shaping, Style, Weight, Wrap,
Action, AttrsList, BorrowedWithFontSystem, Buffer, Change, Color, Cursor, Edit, Editor,
FontSystem, Shaping, Style, Weight, Wrap,
};
pub use syntect::highlighting::Theme as SyntaxTheme;
@ -304,6 +304,14 @@ impl<'a> Edit for SyntaxEditor<'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) {
self.editor.action(font_system, action);
}