Attempt to highlight inlays

This commit is contained in:
Kirill Bulatov 2023-08-22 01:02:25 +03:00
parent 6c5761d05b
commit f8874a726c
4 changed files with 143 additions and 72 deletions

View file

@ -7750,17 +7750,16 @@ impl Editor {
highlights
}
pub fn clear_highlights<T: 'static>(
&mut self,
cx: &mut ViewContext<Self>,
) -> Option<Arc<(HighlightStyle, Vec<Range<Anchor>>)>> {
let highlights = self
pub fn clear_highlights<T: 'static>(&mut self, cx: &mut ViewContext<Self>) {
let text_highlights = self
.display_map
.update(cx, |map, _| map.clear_text_highlights(TypeId::of::<T>()));
if highlights.is_some() {
let inlay_highlights = self
.display_map
.update(cx, |map, _| map.clear_inlay_highlights(TypeId::of::<T>()));
if text_highlights.is_some() || inlay_highlights.is_some() {
cx.notify();
}
highlights
}
pub fn show_local_cursors(&self, cx: &AppContext) -> bool {