editor: Move blame popover from hover_tooltip
to editor prepaint (#29320)
WIP! In light of having more control over blame popover from editor. This fixes: https://github.com/zed-industries/zed/issues/28645, https://github.com/zed-industries/zed/issues/26304 - [x] Initial rendering - [x] Handle smart positioning (edge detection, etc) - [x] Delayed hovering, release, etc - [x] Test blame message selection - [x] Fix tagged issues Release Notes: - Git inline blame popover now dismisses when the cursor is moved, the editor is scrolled, or the command palette is opened.
This commit is contained in:
parent
87f85f1863
commit
d3911e34de
6 changed files with 501 additions and 83 deletions
|
@ -27,22 +27,18 @@ pub struct CommitDetails {
|
|||
pub message: Option<ParsedCommitMessage>,
|
||||
}
|
||||
|
||||
struct CommitAvatar<'a> {
|
||||
pub struct CommitAvatar<'a> {
|
||||
commit: &'a CommitDetails,
|
||||
}
|
||||
|
||||
impl<'a> CommitAvatar<'a> {
|
||||
fn new(details: &'a CommitDetails) -> Self {
|
||||
pub fn new(details: &'a CommitDetails) -> Self {
|
||||
Self { commit: details }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> CommitAvatar<'a> {
|
||||
fn render(
|
||||
&'a self,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<CommitTooltip>,
|
||||
) -> Option<impl IntoElement + use<>> {
|
||||
pub fn render(&'a self, window: &mut Window, cx: &mut App) -> Option<impl IntoElement + use<>> {
|
||||
let remote = self
|
||||
.commit
|
||||
.message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue