Cache syntax highlighting results
This commit is contained in:
parent
f85223b376
commit
1e1164f4b2
2 changed files with 73 additions and 18 deletions
|
|
@ -201,6 +201,10 @@ impl<'a> TextBufferLine<'a> {
|
|||
self.layout_opt = None;
|
||||
}
|
||||
|
||||
pub fn is_reset(&self) -> bool {
|
||||
self.shape_opt.is_none()
|
||||
}
|
||||
|
||||
pub fn shape(&mut self, font_system: &'a FontSystem<'a>) -> &ShapeLine {
|
||||
if self.shape_opt.is_none() {
|
||||
self.shape_opt = Some(ShapeLine::new(font_system, &self.text, &self.attrs_list));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue