Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

add indent size to project panel settings

Derek Briggsabb145da7026
diff --git a/assets/settings/default.json b/assets/settings/default.json
index 343abbf077f..6dc573ddb6c 100644
--- a/assets/settings/default.json
+++ b/assets/settings/default.json
@@ -102,16 +102,18 @@
"show_other_hints": true
},
"project_panel": {
- // Whether to show the git status in the project panel.
- "git_status": true,
+ // Default width of the project panel.
+ "default_width": 240,
+ // Where to dock project panel. Can be 'left' or 'right'.
+ "dock": "left",
// Whether to show file icons in the project panel.
"file_icons": true,
// Whether to show folder icons or chevrons for directories in the project panel.
"folder_icons": true,
- // Where to dock project panel. Can be 'left' or 'right'.
- "dock": "left",
- // Default width of the project panel.
- "default_width": 240
+ // Whether to show the git status in the project panel.
+ "git_status": true,
+ // Amount of indentation for nested items.
+ "indent_size": 20
},
"assistant": {
// Where to dock the assistant. Can be 'left', 'right' or 'bottom'.
diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs
index 014649f9a81..8164b2860ae 100644
--- a/crates/project_panel/src/project_panel.rs
+++ b/crates/project_panel/src/project_panel.rs
@@ -1332,7 +1332,8 @@ impl ProjectPanel {
) -> AnyElement<Self> {
let kind = details.kind;
let path = details.path.clone();
- let padding = theme.container.padding.left + details.depth as f32 * theme.indent_width;
+ let settings = settings::get::<ProjectPanelSettings>(cx);
+ let padding = theme.container.padding.left + details.depth as f32 * settings.indent_size;
let entry_style = if details.is_cut {
&theme.cut_entry