summaryrefslogtreecommitdiff
path: root/helix-term/src/ui/popup.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui/popup.rs')
-rw-r--r--helix-term/src/ui/popup.rs8
1 files changed, 7 insertions, 1 deletions
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)
+ }
}