Restore hover action in the editor (#4016)
Deals with https://github.com/zed-industries/community/issues/2304 Deals with https://github.com/zed-industries/community/issues/2394 Release Notes: - Fixed `editor::Hover` action (and `g h` command in Vim mode) not working
This commit is contained in:
commit
b342c92495
1 changed files with 4 additions and 6 deletions
|
@ -2,13 +2,13 @@ use crate::{
|
||||||
display_map::{InlayOffset, ToDisplayPoint},
|
display_map::{InlayOffset, ToDisplayPoint},
|
||||||
link_go_to_definition::{InlayHighlight, RangeInEditor},
|
link_go_to_definition::{InlayHighlight, RangeInEditor},
|
||||||
Anchor, AnchorRangeExt, DisplayPoint, Editor, EditorSettings, EditorSnapshot, EditorStyle,
|
Anchor, AnchorRangeExt, DisplayPoint, Editor, EditorSettings, EditorSnapshot, EditorStyle,
|
||||||
ExcerptId, RangeToAnchorExt,
|
ExcerptId, Hover, RangeToAnchorExt,
|
||||||
};
|
};
|
||||||
use futures::FutureExt;
|
use futures::FutureExt;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions, div, px, AnyElement, CursorStyle, Hsla, InteractiveElement, IntoElement, Model,
|
div, px, AnyElement, CursorStyle, Hsla, InteractiveElement, IntoElement, Model, MouseButton,
|
||||||
MouseButton, ParentElement, Pixels, SharedString, Size, StatefulInteractiveElement, Styled,
|
ParentElement, Pixels, SharedString, Size, StatefulInteractiveElement, Styled, Task,
|
||||||
Task, ViewContext, WeakView,
|
ViewContext, WeakView,
|
||||||
};
|
};
|
||||||
use language::{markdown, Bias, DiagnosticEntry, Language, LanguageRegistry, ParsedMarkdown};
|
use language::{markdown, Bias, DiagnosticEntry, Language, LanguageRegistry, ParsedMarkdown};
|
||||||
|
|
||||||
|
@ -27,8 +27,6 @@ pub const MIN_POPOVER_CHARACTER_WIDTH: f32 = 20.;
|
||||||
pub const MIN_POPOVER_LINE_HEIGHT: Pixels = px(4.);
|
pub const MIN_POPOVER_LINE_HEIGHT: Pixels = px(4.);
|
||||||
pub const HOVER_POPOVER_GAP: Pixels = px(10.);
|
pub const HOVER_POPOVER_GAP: Pixels = px(10.);
|
||||||
|
|
||||||
actions!(editor, [Hover]);
|
|
||||||
|
|
||||||
/// Bindable action which uses the most recent selection head to trigger a hover
|
/// Bindable action which uses the most recent selection head to trigger a hover
|
||||||
pub fn hover(editor: &mut Editor, _: &Hover, cx: &mut ViewContext<Editor>) {
|
pub fn hover(editor: &mut Editor, _: &Hover, cx: &mut ViewContext<Editor>) {
|
||||||
let head = editor.selections.newest_display(cx).head();
|
let head = editor.selections.newest_display(cx).head();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue