aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/menu.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui/menu.rs')
-rw-r--r--helix-term/src/ui/menu.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs
index 9758732c..e127e09b 100644
--- a/helix-term/src/ui/menu.rs
+++ b/helix-term/src/ui/menu.rs
@@ -14,11 +14,18 @@ use helix_view::{graphics::Rect, Editor};
use tui::layout::Constraint;
pub trait Item {
- fn sort_text(&self) -> &str;
- fn filter_text(&self) -> &str;
-
fn label(&self) -> &str;
- fn row(&self) -> Row;
+
+ fn sort_text(&self) -> &str {
+ self.label()
+ }
+ fn filter_text(&self) -> &str {
+ self.label()
+ }
+
+ fn row(&self) -> Row {
+ Row::new(vec![Cell::from(self.label())])
+ }
}
pub struct Menu<T: Item> {