Skip to content

Commit

Permalink
Fix a completions panic when no fuzzy matches + inline completion (#2…
Browse files Browse the repository at this point in the history
…3019)

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.
  • Loading branch information
mgsloan authored Jan 12, 2025
1 parent 5785266 commit 61115bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/editor/src/code_context_menus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 61115bd

Please sign in to comment.