From 8214d6489c33d2e2134f5274c84ee86e972c3e18 Mon Sep 17 00:00:00 2001 From: Kunall Banerjee Date: Fri, 15 May 2026 10:17:57 -0400 Subject: [PATCH] settings_ui: Match all query words in search (#56835) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Settings search treated multi-word queries as OR, so “tab size” matched any document whose words contained a prefix of “tab” or “size” -- flooding results with unrelated entries like “Show Tab Bar” and “Maximum Tabs”. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #56244. Release Notes: - Fixed settings UI search returning unrelated results for multi-word queries --- crates/settings_ui/src/settings_ui.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs index fcc3cbecc8..f8d938e9ee 100644 --- a/crates/settings_ui/src/settings_ui.rs +++ b/crates/settings_ui/src/settings_ui.rs @@ -1982,11 +1982,14 @@ impl SettingsWindow { async move { let query_lower = query.to_lowercase(); let query_words: Vec<&str> = query_lower.split_whitespace().collect(); + if query_words.is_empty() { + return Vec::new(); + } search_index .documents .iter() .filter(|doc| { - query_words.iter().any(|query_word| { + query_words.iter().all(|query_word| { doc.words .iter() .any(|doc_word| doc_word.starts_with(query_word))