On rename, replace background highlights with transparent text highlights

This commit is contained in:
Nathan Sobo 2022-03-11 15:54:17 -07:00
parent 951fd1ab36
commit c35a96c425
2 changed files with 30 additions and 9 deletions

View file

@ -174,8 +174,11 @@ impl DisplayMap {
.insert(Some(type_id), Arc::new((style, ranges)));
}
pub fn clear_text_highlights(&mut self, type_id: TypeId) {
self.text_highlights.remove(&Some(type_id));
pub fn clear_text_highlights(
&mut self,
type_id: TypeId,
) -> Option<Arc<(HighlightStyle, Vec<Range<Anchor>>)>> {
self.text_highlights.remove(&Some(type_id))
}
pub fn set_font(&self, font_id: FontId, font_size: f32, cx: &mut ModelContext<Self>) {