mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-25 23:04:27 +00:00
file_finder: Put collab channel inclusion behind a setting (#51505)
Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
parent
e29206b569
commit
f04b4e089f
4 changed files with 13 additions and 1 deletions
|
|
@ -1285,6 +1285,8 @@
|
|||
// * "indexed": Use only the files Zed had indexed
|
||||
// * "smart": Be smart and search for ignored when called from a gitignored worktree
|
||||
"include_ignored": "smart",
|
||||
// Whether to include text channels in file finder results.
|
||||
"include_channels": false,
|
||||
},
|
||||
// Whether or not to remove any trailing whitespace from lines of a buffer
|
||||
// before saving it.
|
||||
|
|
|
|||
|
|
@ -844,7 +844,11 @@ impl FileFinderDelegate {
|
|||
cx: &mut Context<FileFinder>,
|
||||
) -> Self {
|
||||
Self::subscribe_to_updates(&project, window, cx);
|
||||
let channel_store = ChannelStore::try_global(cx);
|
||||
let channel_store = if FileFinderSettings::get_global(cx).include_channels {
|
||||
ChannelStore::try_global(cx)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
Self {
|
||||
file_finder,
|
||||
workspace,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ pub struct FileFinderSettings {
|
|||
pub modal_max_width: FileFinderWidth,
|
||||
pub skip_focus_for_active_in_search: bool,
|
||||
pub include_ignored: Option<bool>,
|
||||
pub include_channels: bool,
|
||||
}
|
||||
|
||||
impl Settings for FileFinderSettings {
|
||||
|
|
@ -23,6 +24,7 @@ impl Settings for FileFinderSettings {
|
|||
settings::IncludeIgnoredContent::Indexed => Some(false),
|
||||
settings::IncludeIgnoredContent::Smart => None,
|
||||
},
|
||||
include_channels: file_finder.include_channels.unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -721,6 +721,10 @@ pub struct FileFinderSettingsContent {
|
|||
///
|
||||
/// Default: Smart
|
||||
pub include_ignored: Option<IncludeIgnoredContent>,
|
||||
/// Whether to include text channels in file finder results.
|
||||
///
|
||||
/// Default: false
|
||||
pub include_channels: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue