diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 7955aac5e52d3a7fce7299b2d811636a9db2b085..1a8c8600bf5bcbde37d0d4fcfb8a2133bba3766d 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -3990,6 +3990,10 @@ impl Editor { return true; } + if self.hide_blame_popover(true, cx) { + return true; + } + if hide_hover(self, cx) { return true; } @@ -6839,13 +6843,15 @@ impl Editor { } } - fn hide_blame_popover(&mut self, cx: &mut Context) { + fn hide_blame_popover(&mut self, ignore_timeout: bool, cx: &mut Context) -> bool { self.inline_blame_popover_show_task.take(); if let Some(state) = &mut self.inline_blame_popover { let hide_task = cx.spawn(async move |editor, cx| { - cx.background_executor() - .timer(std::time::Duration::from_millis(100)) - .await; + if !ignore_timeout { + cx.background_executor() + .timer(std::time::Duration::from_millis(100)) + .await; + } editor .update(cx, |editor, cx| { editor.inline_blame_popover.take(); @@ -6854,6 +6860,9 @@ impl Editor { .ok(); }); state.hide_task = Some(hide_task); + true + } else { + false } } diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 65c9d1dbc78d14ab1419118f1d56d2b10a494ba6..c726de49475ac62eb6c04c05f8163a17218e57cf 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -1207,10 +1207,10 @@ impl EditorElement { if mouse_over_inline_blame || mouse_over_popover { editor.show_blame_popover(*buffer_id, blame_entry, event.position, false, cx); } else if !keyboard_grace { - editor.hide_blame_popover(cx); + editor.hide_blame_popover(false, cx); } } else { - editor.hide_blame_popover(cx); + editor.hide_blame_popover(false, cx); } let breakpoint_indicator = if gutter_hovered {