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)
This commit is contained in:
Finn Evers
2026-11-12 00:08:05 +00:00
committed by GitHub
parent f99c53f4f6
commit 3e23a0c482
3 changed files with 36 additions and 3 deletions
+2 -2
View File
@@ -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.
@@ -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()
+1 -1
View File
@@ -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**