add hover popover setting

This commit is contained in:
Keith Simmons
2022-06-27 16:21:22 -07:00
parent a477733bcb
commit 1eb8351440
2 changed files with 13 additions and 4 deletions
+7 -4
View File
@@ -7,6 +7,7 @@ use gpui::{
};
use language::Bias;
use project::{HoverBlock, Project};
use settings::Settings;
use std::{ops::Range, time::Duration};
use util::TryFutureExt;
@@ -40,10 +41,12 @@ pub fn hover(editor: &mut Editor, _: &Hover, cx: &mut ViewContext<Editor>) {
/// The internal hover action dispatches between `show_hover` or `hide_hover`
/// depending on whether a point to hover over is provided.
pub fn hover_at(editor: &mut Editor, action: &HoverAt, cx: &mut ViewContext<Editor>) {
if let Some(point) = action.point {
show_hover(editor, point, false, cx);
} else {
hide_hover(editor, cx);
if cx.global::<Settings>().hover_popover_enabled {
if let Some(point) = action.point {
show_hover(editor, point, false, cx);
} else {
hide_hover(editor, cx);
}
}
}