diff options
Diffstat (limited to 'helix-term/src/ui/menu.rs')
-rw-r--r-- | helix-term/src/ui/menu.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs index 3ae00703..8aa10c08 100644 --- a/helix-term/src/ui/menu.rs +++ b/helix-term/src/ui/menu.rs @@ -43,6 +43,8 @@ impl Item for PathBuf { } } +pub type MenuCallback<T> = Box<dyn Fn(&mut Editor, Option<&T>, MenuEvent)>; + pub struct Menu<T: Item> { options: Vec<T>, editor_data: T::Data, @@ -55,7 +57,7 @@ pub struct Menu<T: Item> { widths: Vec<Constraint>, - callback_fn: Box<dyn Fn(&mut Editor, Option<&T>, MenuEvent)>, + callback_fn: MenuCallback<T>, scroll: usize, size: (u16, u16), |