summaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorKirawi2021-12-08 07:11:18 +0000
committerGitHub2021-12-08 07:11:18 +0000
commit29c053e84e2624feb786f520ebae4c752bc23279 (patch)
treed537982f3f7304142a84b0affacc5f830bca105c /helix-term/src/ui
parentd08bdfa838098769afc59146b62f9d613d4a7ff4 (diff)
Only use a single documentation popup (#1241)
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/completion.rs2
-rw-r--r--helix-term/src/ui/popup.rs8
2 files changed, 8 insertions, 2 deletions
diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs
index dd782d29..fcd63199 100644
--- a/helix-term/src/ui/completion.rs
+++ b/helix-term/src/ui/completion.rs
@@ -168,7 +168,7 @@ impl Completion {
}
};
});
- let popup = Popup::new(menu);
+ let popup = Popup::new("completion", menu);
let mut completion = Self {
popup,
start_offset,
diff --git a/helix-term/src/ui/popup.rs b/helix-term/src/ui/popup.rs
index 8f7921a1..a5310b23 100644
--- a/helix-term/src/ui/popup.rs
+++ b/helix-term/src/ui/popup.rs
@@ -16,15 +16,17 @@ pub struct Popup<T: Component> {
position: Option<Position>,
size: (u16, u16),
scroll: usize,
+ id: &'static str,
}
impl<T: Component> Popup<T> {
- pub fn new(contents: T) -> Self {
+ pub fn new(id: &'static str, contents: T) -> Self {
Self {
contents,
position: None,
size: (0, 0),
scroll: 0,
+ id,
}
}
@@ -143,4 +145,8 @@ impl<T: Component> Component for Popup<T> {
self.contents.render(area, surface, cx);
}
+
+ fn id(&self) -> Option<&'static str> {
+ Some(self.id)
+ }
}