diff options
Diffstat (limited to 'helix-term/src/ui/menu.rs')
-rw-r--r-- | helix-term/src/ui/menu.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs index fbd25a6d..30ac044c 100644 --- a/helix-term/src/ui/menu.rs +++ b/helix-term/src/ui/menu.rs @@ -123,11 +123,19 @@ impl<T> Menu<T> { .map(|(index, _score)| &self.options[*index]) }) } + + pub fn is_empty(&self) -> bool { + self.matches.is_empty() + } + + pub fn len(&self) -> usize { + self.matches.len() + } } use super::PromptEvent as MenuEvent; -impl<T> Component for Menu<T> { +impl<T: 'static> Component for Menu<T> { fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult { let event = match event { Event::Key(event) => event, |