Add support for excluding files based on .gitignore
(#26636)
Closes: #17543 Release Notes: - **New Feature:** Introduced the ability to automatically remove files and directories from the Zed project panel that are specified in `.gitignore`. - **Configuration Option:** This behavior can be controlled via the new `project_panel.hide_gitignore` setting. By setting it to `true`, files listed in `.gitignore` will be excluded from the project panel. - **Toggle:** Ability to toggle this setting using the action `ProjectPanel::ToggleHideGitIgnore` ```json "project_panel": { "hide_gitignore": true }, ``` This results in a cleaner and easier to browse project panel for projects that generate a lot of object files like `xv6-riscv` or `linux` without needing to tweak `file_scan_exclusions` on `settings.json` **Preview:** - With `"project_panel.hide_gitignore": false` (default, this is how zed currently looks)  - With `"project_panel.hide_gitignore": true`  - Action `ProjectPanel::ToggleHideGitIgnore` 
This commit is contained in:
parent
9eacac62a9
commit
82536f5243
4 changed files with 196 additions and 8 deletions
|
@ -31,6 +31,7 @@ pub enum EntrySpacing {
|
|||
#[derive(Deserialize, Debug, Clone, Copy, PartialEq)]
|
||||
pub struct ProjectPanelSettings {
|
||||
pub button: bool,
|
||||
pub hide_gitignore: bool,
|
||||
pub default_width: Pixels,
|
||||
pub dock: ProjectPanelDockPosition,
|
||||
pub entry_spacing: EntrySpacing,
|
||||
|
@ -93,6 +94,10 @@ pub struct ProjectPanelSettingsContent {
|
|||
///
|
||||
/// Default: true
|
||||
pub button: Option<bool>,
|
||||
/// Whether to hide gitignore files in the project panel.
|
||||
///
|
||||
/// Default: false
|
||||
pub hide_gitignore: Option<bool>,
|
||||
/// Customize default width (in pixels) taken by project panel
|
||||
///
|
||||
/// Default: 240
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue