From 3e23a0c48201a9cc34ad4a3a4225910247de41f4 Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Thu, 12 Nov 2026 00:08:05 +0000 Subject: [PATCH] Change the default settings value for `file_finder.prefill_query_from_selection` (#66856) Closes https://github.com/zed-industries/zed/issues/66651 Changes the default for `prefill_query_from_selection`, as this is a rather intrusive setting/breaking change and should not have went in like it did here for all finders. ## Testing Updated the existing tests. ## Self-review - [X] I've reviewed my diff for quality, security, reliability, and performance. - [N/A] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [X] Tests cover the new or changed behavior. Release Notes: - Breaking: Changed the default value for the `file_finder.prefill_query_from_selection` from `true` to `false`. If you want to return to the previous behavior, toggle the setting at [zed://settings/file_finder.prefill_query_from_selection](zed://settings/file_finder.prefill_query_from_selection) --- assets/settings/default.json | 4 +-- crates/file_finder/src/file_finder_tests.rs | 33 +++++++++++++++++++++ docs/src/reference/all-settings.md | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/assets/settings/default.json b/assets/settings/default.json index d72a7123730..802c0f2f387 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -1623,8 +1623,8 @@ // Whether to pre-fill the file finder's query with the text selected in the // focused item (e.g. an editor or a terminal) when it is opened. // - // Default: true - "prefill_query_from_selection": true, + // Default: false + "prefill_query_from_selection": false, }, // Whether or not to remove any trailing whitespace from lines of a buffer // before saving it. diff --git a/crates/file_finder/src/file_finder_tests.rs b/crates/file_finder/src/file_finder_tests.rs index 59cff873c66..ffb6dbde575 100644 --- a/crates/file_finder/src/file_finder_tests.rs +++ b/crates/file_finder/src/file_finder_tests.rs @@ -5734,6 +5734,17 @@ fn select_range_in_active_editor( async fn test_seed_query_from_editor_selection(cx: &mut TestAppContext) { let app_state = init_test(cx); + cx.update(|cx| { + let settings = *FileFinderSettings::get_global(cx); + FileFinderSettings::override_global( + FileFinderSettings { + prefill_query_from_selection: true, + ..settings + }, + cx, + ); + }); + app_state .fs .as_fake() @@ -5773,6 +5784,17 @@ async fn test_seed_query_from_editor_selection(cx: &mut TestAppContext) { async fn test_no_seed_query_without_selection(cx: &mut TestAppContext) { let app_state = init_test(cx); + cx.update(|cx| { + let settings = *FileFinderSettings::get_global(cx); + FileFinderSettings::override_global( + FileFinderSettings { + prefill_query_from_selection: true, + ..settings + }, + cx, + ); + }); + app_state .fs .as_fake() @@ -5808,6 +5830,17 @@ async fn test_no_seed_query_without_selection(cx: &mut TestAppContext) { async fn test_seed_query_flattens_multiline_selection(cx: &mut TestAppContext) { let app_state = init_test(cx); + cx.update(|cx| { + let settings = *FileFinderSettings::get_global(cx); + FileFinderSettings::override_global( + FileFinderSettings { + prefill_query_from_selection: true, + ..settings + }, + cx, + ); + }); + app_state .fs .as_fake() diff --git a/docs/src/reference/all-settings.md b/docs/src/reference/all-settings.md index a72e40ac7e7..818ddaee97d 100644 --- a/docs/src/reference/all-settings.md +++ b/docs/src/reference/all-settings.md @@ -4695,7 +4695,7 @@ These settings belong inside the `file_finder` object. - Description: Prefill the file finder query with text selected in the focused item, such as an editor or terminal. - Setting: `prefill_query_from_selection` -- Default: `true` +- Default: `false` **Options**