diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 7f84772a452b9208463c2a233dfd57eda7c1ac52..cc8347248b8c78f1022d1d0756dc87d966631728 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -5792,8 +5792,11 @@ impl Editor { &mut self, cx: &mut ViewContext, ) -> Option<(fn(&Theme) -> Color, Vec>)> { - cx.notify(); - self.background_highlights.remove(&TypeId::of::()) + let highlights = self.background_highlights.remove(&TypeId::of::()); + if highlights.is_some() { + cx.notify(); + } + highlights } #[cfg(feature = "test-support")] @@ -5907,9 +5910,13 @@ impl Editor { &mut self, cx: &mut ViewContext, ) -> Option>)>> { - cx.notify(); - self.display_map - .update(cx, |map, _| map.clear_text_highlights(TypeId::of::())) + let highlights = self + .display_map + .update(cx, |map, _| map.clear_text_highlights(TypeId::of::())); + if highlights.is_some() { + cx.notify(); + } + highlights } fn next_blink_epoch(&mut self) -> usize {