A simple CPU rendered GUI IDE experience.
Diffstat (limited to 'src/text.rs')
| -rw-r--r-- | src/text.rs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/text.rs b/src/text.rs index 72ec25b..2f4d30a 100644 --- a/src/text.rs +++ b/src/text.rs @@ -948,7 +948,7 @@ impl TextArea { // arc_swap::Guard<Arc<Box<[SemanticToken]>>>, // &SemanticTokensLegend, // )>; - if leg.is_none() { + if leg.is_none() || self.tokens.is_empty() { self.tree_sit(path, &mut cells); } if let Some(tabstops) = &self.tabstops { @@ -1110,6 +1110,28 @@ impl TextArea { } best } + + pub(crate) fn apply_tedits_adjusting( + &mut self, + teds: &mut [TextEdit], + ) -> Result<(), ()> { + teds.sort_tedits(); + for ted in teds { + self.apply_adjusting(ted)?; + } + Ok(()) + } + + pub(crate) fn apply_tedits( + &mut self, + teds: &mut [TextEdit], + ) -> Result<(), ()> { + teds.sort_tedits(); + for ted in teds { + self.apply(ted)?; + } + Ok(()) + } } pub fn is_word(r: char) -> bool { |