Start work on new text input handling in Editor

This commit is contained in:
Max Brunsfeld 2022-07-20 16:45:27 -07:00
parent 0b81a4dfae
commit f985515141
6 changed files with 129 additions and 43 deletions

View file

@ -195,6 +195,11 @@ impl DisplayMap {
.insert(Some(type_id), Arc::new((style, ranges)));
}
pub fn text_highlights(&self, type_id: TypeId) -> Option<(HighlightStyle, &[Range<Anchor>])> {
let highlights = self.text_highlights.get(&Some(type_id))?;
Some((highlights.0, &highlights.1))
}
pub fn clear_text_highlights(
&mut self,
type_id: TypeId,