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**