From 61115bd04792d87a540558753cd01a6368baba2a Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Sat, 11 Jan 2025 19:41:28 -0700 Subject: [PATCH] Fix a completions panic when no fuzzy matches + inline completion (#23019) My mistake in #22977, in the case where the inline completion was not selected it set the index to 1 assuming there would be following match entries. --- crates/editor/src/code_context_menus.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/editor/src/code_context_menus.rs b/crates/editor/src/code_context_menus.rs index 5fce4cbb1bb61..2e3963f85f671 100644 --- a/crates/editor/src/code_context_menus.rs +++ b/crates/editor/src/code_context_menus.rs @@ -773,7 +773,7 @@ impl CompletionsMenu { let mut entries = self.entries.borrow_mut(); if let Some(CompletionEntry::InlineCompletionHint(_)) = entries.first() { entries.truncate(1); - if inline_completion_was_selected { + if inline_completion_was_selected || matches.is_empty() { self.selected_item = 0; } else { self.selected_item = 1;