Skip to content

Commit

Permalink
handle empty menu as inapplicable
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdillah committed Jul 20, 2023
1 parent c8bc5ac commit 122d3f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,10 @@ impl Reedline {
if self.active_menu().is_none() {
if let Some(menu) = self.menus.iter_mut().find(|menu| menu.name() == name) {
menu.menu_event(MenuEvent::Activate(self.quick_completions));
if menu.get_values().len() == 0 {
menu.menu_event(MenuEvent::Deactivate);
return Ok(EventStatus::Inapplicable);
}

if self.quick_completions && menu.can_quick_complete() {
menu.update_values(
Expand Down

0 comments on commit 122d3f2

Please sign in to comment.