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.

settings_ui: Display scope in the breadcrumb (#57437)

Danilo Leal139954071524
diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs
index 5f9d323746e..08ac192c88b 100644
--- a/crates/settings_ui/src/settings_ui.rs
+++ b/crates/settings_ui/src/settings_ui.rs
@@ -3006,19 +3006,26 @@ impl SettingsWindow {
}
fn render_sub_page_breadcrumbs(&self) -> impl IntoElement {
+ let scope_name: SharedString = self
+ .display_name(&self.current_file)
+ .unwrap_or_else(|| self.current_file.setting_type().to_string())
+ .into();
+
h_flex().min_w_0().gap_1().overflow_x_hidden().children(
itertools::intersperse(
- std::iter::once(self.current_page().title.into()).chain(
- self.sub_page_stack
- .iter()
- .enumerate()
- .flat_map(|(index, page)| {
- (index == 0)
- .then(|| page.section_header.clone())
- .into_iter()
- .chain(std::iter::once(page.link.title.clone()))
- }),
- ),
+ std::iter::once(scope_name)
+ .chain(std::iter::once(self.current_page().title.into()))
+ .chain(
+ self.sub_page_stack
+ .iter()
+ .enumerate()
+ .flat_map(|(index, page)| {
+ (index == 0)
+ .then(|| page.section_header.clone())
+ .into_iter()
+ .chain(std::iter::once(page.link.title.clone()))
+ }),
+ ),
"/".into(),
)
.map(|item| Label::new(item).color(Color::Muted)),