Properly calculate y offsets for multi buffer context menus (#15594)
Follow-up of https://github.com/zed-industries/zed/pull/14727 Release Notes: - Fixed multi buffer context menus not showing properly Co-authored-by: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
9b24e7d6de
commit
c98918aed8
2 changed files with 17 additions and 22 deletions
|
@ -10,6 +10,7 @@ use gpui::prelude::FluentBuilder;
|
|||
use gpui::{DismissEvent, Pixels, Point, Subscription, View, ViewContext};
|
||||
use workspace::OpenInTerminal;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum MenuPosition {
|
||||
/// When the editor is scrolled, the context menu stays on the exact
|
||||
/// same position on the screen, never disappearing.
|
||||
|
@ -29,6 +30,15 @@ pub struct MouseContextMenu {
|
|||
_subscription: Subscription,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for MouseContextMenu {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("MouseContextMenu")
|
||||
.field("position", &self.position)
|
||||
.field("context_menu", &self.context_menu)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl MouseContextMenu {
|
||||
pub(crate) fn pinned_to_editor(
|
||||
editor: &mut Editor,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue