editor: Prevent blame popover from appearing when cursor is on different pane (#52603)

The blame popover shouldn't appear when the cursor hovers over the
annotation but on a different pane.

Before:


https://github.com/user-attachments/assets/dbf6f7b5-e27f-495b-8d6f-fa75a4feee18

After:


https://github.com/user-attachments/assets/d5e186df-4ebf-4b4c-bb5f-4d9e7b0f62c7

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed a bug that caused git blame annotations to be hoverable from a
different pane.
This commit is contained in:
Tim Vermeulen 2026-04-01 16:41:50 +02:00 committed by GitHub
parent dcef83e413
commit 4a0c02b69c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1289,7 +1289,9 @@ impl EditorElement {
cx.notify();
}
if let Some((bounds, buffer_id, blame_entry)) = &position_map.inline_blame_bounds {
if text_hovered
&& let Some((bounds, buffer_id, blame_entry)) = &position_map.inline_blame_bounds
{
let mouse_over_inline_blame = bounds.contains(&event.position);
let mouse_over_popover = editor
.inline_blame_popover