From 1375c7b7e4068fd6ec3c27545d420f2ba7c34512 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 3 Feb 2022 14:36:25 +0100 Subject: [PATCH] Fix panic when trying to show completions but none match the query --- crates/editor/src/editor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index d3b365329fe3d56c0288005a317a7a2c25ac3870..7469665202441fc4e540a6d73b6934f56cbef284 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -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 {