Skip to content

Commit b535ff9

Browse files
committed
handle empty menu as inapplicable
1 parent adc20cb commit b535ff9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/engine.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,11 @@ impl Reedline {
967967
return Ok(EventStatus::Handled);
968968
}
969969

970+
if menu.get_values().len() == 0 {
971+
menu.menu_event(MenuEvent::Deactivate);
972+
return Ok(EventStatus::Inapplicable);
973+
}
974+
970975
return Ok(EventStatus::Handled);
971976
}
972977
}

0 commit comments

Comments
 (0)