summaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
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)
+ }
}