Fix panic when trying to show completions but none match the query

This commit is contained in:
Antonio Scandurra 2022-02-03 14:36:25 +01:00
parent 85e6ea1091
commit 1375c7b7e4

View file

@ -1711,7 +1711,9 @@ impl Editor {
}
pub fn has_completions(&self) -> bool {
self.completion_state.is_some()
self.completion_state
.as_ref()
.map_or(false, |c| !c.matches.is_empty())
}
pub fn render_completions(&self, cx: &AppContext) -> Option<ElementBox> {