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 53b6a78
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,11 @@ impl Reedline {
return Ok(EventStatus::Handled);
}

if menu.get_values().len() == 0 {
menu.menu_event(MenuEvent::Deactivate);
return Ok(EventStatus::Inapplicable);
}

return Ok(EventStatus::Handled);
}
}
Expand Down

0 comments on commit 53b6a78

Please sign in to comment.