Confirm the selected command and return its name
(&mut self)
| 100 | |
| 101 | /// Confirm the selected command and return its name |
| 102 | pub fn apply_selection(&mut self) -> Option<String> { |
| 103 | if !self.visible { |
| 104 | return None; |
| 105 | } |
| 106 | |
| 107 | let selected = self.selected_item()?; |
| 108 | let command = selected.name.to_string(); |
| 109 | self.suppress(); |
| 110 | Some(command) |
| 111 | } |
| 112 | |
| 113 | pub fn render(&mut self, frame: &mut Frame, area: Rect, theme: &Theme) { |
| 114 | if !self.visible || area.height < 3 { |
no test coverage detected