Hide hover when font changes, and handle case where delay was preventing hover with large symbol range

This commit is contained in:
Keith Simmons 2022-06-08 11:54:24 -07:00
parent b51bd87c10
commit 1da1853a76
4 changed files with 43 additions and 17 deletions

View file

@ -121,10 +121,18 @@ impl WrapMap {
(self.snapshot.clone(), mem::take(&mut self.edits_since_sync))
}
pub fn set_font(&mut self, font_id: FontId, font_size: f32, cx: &mut ModelContext<Self>) {
pub fn set_font(
&mut self,
font_id: FontId,
font_size: f32,
cx: &mut ModelContext<Self>,
) -> bool {
if (font_id, font_size) != self.font {
self.font = (font_id, font_size);
self.rewrap(cx)
self.rewrap(cx);
true
} else {
false
}
}