From 243fb3562c79b233389cea035a660bff6af857ff Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 26 Jul 2024 15:26:20 +0300 Subject: [PATCH] Auto fold directories in the project panel by default (#15273) --- assets/settings/default.json | 2 +- crates/project_panel/src/project_panel.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/assets/settings/default.json b/assets/settings/default.json index 743ec545f1..4a1ed777fd 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -312,7 +312,7 @@ "auto_reveal_entries": true, // Whether to fold directories automatically and show compact folders // (e.g. "a/b/c" ) when a directory has only one subdirectory inside. - "auto_fold_dirs": false, + "auto_fold_dirs": true, /// Scrollbar-related settings "scrollbar": { /// When to show the scrollbar in the project panel. diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index 34e6e91193..c2f26d2e5c 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -5085,6 +5085,9 @@ mod tests { Project::init_settings(cx); cx.update_global::(|store, cx| { + store.update_user_settings::(cx, |project_panel_settings| { + project_panel_settings.auto_fold_dirs = Some(false); + }); store.update_user_settings::(cx, |worktree_settings| { worktree_settings.file_scan_exclusions = Some(Vec::new()); }); @@ -5102,6 +5105,15 @@ mod tests { crate::init((), cx); workspace::init(app_state.clone(), cx); Project::init_settings(cx); + + cx.update_global::(|store, cx| { + store.update_user_settings::(cx, |project_panel_settings| { + project_panel_settings.auto_fold_dirs = Some(false); + }); + store.update_user_settings::(cx, |worktree_settings| { + worktree_settings.file_scan_exclusions = Some(Vec::new()); + }); + }); }); }